Code Monkey home page Code Monkey logo

pepsimaxhunter's Introduction

PepsiMaxHunter uses the pre-filled links in lines 4-9. the Program then accesses the links and pulls the prices and pack sizes from the JSON data then performs math to get the price per can It then sorts the results by price per can It then pushes the result via Pushover

Lines 180 and 181 need to be edited with your pushover account info.

This is currently optimised for Pepsi Max only and appears to have issues with other canned drinks. I am going to be working on changing this to universal support for all multi-pack can drink products.

Pushover is a free Push notification software (not owned by me) that you can call an API to send push notifications to other devices, like iPhone and Android phones. The mobile app does have a one-time purchase price.

Pushover.net

Requires requests and pytz installed

pepsimaxhunter's People

Contributors

ziogref avatar

Watchers

 avatar

pepsimaxhunter's Issues

Woolworths incorrect prices

Woolworths seem to have incorrect prices. The API url does not change but the contents does depending on the selected store.

See if a store cookie can be found to pass to the URL to get the correct prices for preferred store

add amazon as another option

Add support for amazon (if possible). Unsure how amazon will work as search can reveal multiple results for the same item, however the user has to select a link to put into python.

Will have to support break-out incase the link dies due to the seller removing them item also unsure if a link is tied to a seller or item.

requires investigation

Coles JSON url changing

The coles JSON api url changes each week. The format appears to be

The URL starts with
https://www.coles.com.au/_next/data/

Next is a date, that could possibly be based on UTC 0 time. that updates weekly on Wednesdays. So this weeks it is
20230510
and next week should be
20230517

So in this URL example, its
20230510

Next is
.01_
I suspect this is possibly a price revision version.

next is a version number
v3.35.0
each week it increments by 0.01 I am unsure on the exact format being used.

Next is general unchanging text
/en/product/

And last is the product "name" which is found at the end of the coles customer facing URL. e.g
pepsi-soft-drink-cola-max-24-pack-7366022

lastly we have our json format
.json

full URL for example
https://www.coles.com.au/_next/data/20230510.01_v3.35.0/en/product/pepsi-soft-drink-cola-max-24-pack-7366022.json

last week was
https://www.coles.com.au/_next/data/20230502.01_v3.34.0/en/product/pepsi-soft-drink-cola-max-24-pack-7366022.json

Update code to better get pack size

Current code relies on search terms specific to pepsi max. Here is regex provided by Google BARD to a better job

# Import the necessary libraries
import re

# Create a regular expression to match the pack size
regex = re.compile(r"(\d+)x(\d+)ml")

# Loop through the products
for product in products:

    # Match the pack size in the product description
    match = regex.match(product)

    # If a match is found, extract the pack size
    if match:
        print(match.groups()[0])

    # If no match is found, print an error message
    else:
        print(f"No pack size found for {product}")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.