{"id":16162915,"url":"https://github.com/columndeeply/price-tracker","last_synced_at":"2025-04-07T04:40:15.925Z","repository":{"id":177684921,"uuid":"624859706","full_name":"columndeeply/price-tracker","owner":"columndeeply","description":" Price tracker with notifications written in POSIX shell","archived":false,"fork":false,"pushed_at":"2023-04-07T12:47:55.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T08:52:19.194Z","etag":null,"topics":["alerts","ecommerce","notifications","posix","price","price-tracker","price-tracking-system","shell","shopping"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/columndeeply.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-07T12:42:01.000Z","updated_at":"2024-06-02T20:31:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"3cc2eb61-e8d7-400f-b1a3-e9cbd817c993","html_url":"https://github.com/columndeeply/price-tracker","commit_stats":null,"previous_names":["columndeeply/price-tracker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/columndeeply%2Fprice-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/columndeeply%2Fprice-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/columndeeply%2Fprice-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/columndeeply%2Fprice-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/columndeeply","download_url":"https://codeload.github.com/columndeeply/price-tracker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247590252,"owners_count":20963112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alerts","ecommerce","notifications","posix","price","price-tracker","price-tracking-system","shell","shopping"],"created_at":"2024-10-10T02:33:53.066Z","updated_at":"2025-04-07T04:40:15.901Z","avatar_url":"https://github.com/columndeeply.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About the project\nThis is a collection of POSIX shell scripts meant to track price changes on different websites. It's written in a modular style meaning you can write your own price parses for any site you want. As long as your parser returns the two required details (name and price) it should work just fine.\n\n# Requirements\nThere are three requirements, if any of these packages are not installed none of the scripts will run. Make sure to install them:\n- [sqlite3](https://github.com/sqlite/sqlite): all the price history and tracked products are stored in a sqlite database.\n- [pup](https://github.com/ericchiang/pup): used to parse the HTML and extract the name and price.\n- bc: does some math. It usually comes installed by default in most distros.\n\n# Installation\nFirst you'll need to clone this repository. Once you have the project somewhere on your system you should add some URLs to track by running the `toggle.sh` script.\n\n    git clone https://github.com/columndeeply/price-tracker.git\n    cd price-tracker\n    sh toggle.sh \"https://product-url.com/product/1\"\n\nOnce that's done you can add a cronjob to check the prices at certain times. For example, I check the prices every two hours with this cronjob:\n\n    0 */2 * * * sh $HOME/price-tracker/check.sh\n\n# Configuration\nThe only thing you need to change in the `config.sh` file is the variable `root`. This variable should point to the path where you cloned the repository.\n\nOptionally, you can change these variables:\n- `logs`: path to the folder where the URLs will be downloaded when running the `check.sh` script.\n- `debug`: change it to `1` and the script will stop removing the HTML files downloaded once a product has been processed.\n- `max_retries`: how many times the script will try to download a URL before giving up.\n- `wait_time`: how many seconds to wait between each URL download. You can set it to 0 but some sites tend to ban your IP if you're downloading pages too fast.\n\n# Usage\n## Adding/removing products\nTo add or remove a product just run the `toggle.sh` script with the URL as the first parameter. If it exists in the DB it will remove it. Otherwise, it will add it.\n\n## Checking all prices\nRun the `check.sh` script\n\n## Setting up the notifications\nTo receive notifications when a price drops you'll need to change the `notifier.sh` script. This script will always be called when a price changes and it will receive as the first parameter a text that includes the product name, the old price, the new price and its URL. I'm using the `go-sendxmpp` package to receive notifications on my XMPP account but you can change it to send an email, send a notification through Telegram, etc.\n\n# Writing new parsers\nYou can write a parser for any site you want. The only requirements are:\n- The script is named with the full domain of the site without any dots or special characters:\n  - A parser for `example.it` should be named `exampleit.sh`. One for `nl.example.org` should be named `nlexampleorg.sh`. \n  - The example parser I've included is for this domain `demo.ecommercehtml.com`, therefore it's named `demoecommercehtmlcom.sh`.\n- It receives a URL in the first parameter.\n- It downloads said URL using the `file_downloader.sh` script.\n- It returns two lines starting with:\n  - `title/`: should be the name of the product. For example: `title/Oculus VR`\n  - `price/`: should be the current price of the product. For example: `price/149 €`. Preferably it should return only the amount, without extra characters like € or $, but it doesn't really matter.\n\nOptionally your parser can also return extra lines starting with `extras/` with some more information you might want to have in the notification (how many units are in stock or something similar).\n**The `title/` and `price/` fields are mandatory. If the price is empty you should still return a line for it. Same with the name.**\n\n## URL cleaning\nSince the `toggle.sh` script uses the URL of a product to check if it already in the database you might want to clean up some URLs to avoid duplicates. To do this you can modify the `url_cleaner.sh` script to remove unneeded parameters from the URLs. If you're using a plugin like [ClearURLs](https://addons.mozilla.org/firefox/addon/clearurls/) this isn't really needed.\n\n# Licence\nDistributed under the GNU General Public License v3.0 licence. See the [LICENCE](https://github.com/columndeeply/price-tracker/blob/main/LICENSE) file for more information.\n\n# Disclaimer\nPlease be mindful of how many products you're tracking, try to avoid hammering a site too much. Keep it to a few products per site. I'm not responsible if you get your IP banned or your account blocked from any sites while using this script.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolumndeeply%2Fprice-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolumndeeply%2Fprice-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolumndeeply%2Fprice-tracker/lists"}