{"id":22391964,"url":"https://github.com/cecile-hirschauer/ecom-notifier","last_synced_at":"2025-03-26T22:14:41.877Z","repository":{"id":241397648,"uuid":"806745986","full_name":"Cecile-Hirschauer/ecom-notifier","owner":"Cecile-Hirschauer","description":"Price Tracking System","archived":false,"fork":false,"pushed_at":"2024-05-29T15:51:52.000Z","size":458,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T03:44:26.729Z","etag":null,"topics":["python3","scraping","selectolax"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cecile-Hirschauer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-05-27T20:14:51.000Z","updated_at":"2024-05-29T15:53:26.000Z","dependencies_parsed_at":"2024-05-28T05:58:56.168Z","dependency_job_id":"91661d0a-e24d-41dd-8953-c92c4bf5f9f3","html_url":"https://github.com/Cecile-Hirschauer/ecom-notifier","commit_stats":null,"previous_names":["cecile-hirschauer/ecom-notifier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cecile-Hirschauer%2Fecom-notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cecile-Hirschauer%2Fecom-notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cecile-Hirschauer%2Fecom-notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cecile-Hirschauer%2Fecom-notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cecile-Hirschauer","download_url":"https://codeload.github.com/Cecile-Hirschauer/ecom-notifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245743436,"owners_count":20665093,"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":["python3","scraping","selectolax"],"created_at":"2024-12-05T04:14:59.202Z","updated_at":"2025-03-26T22:14:41.861Z","avatar_url":"https://github.com/Cecile-Hirschauer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ecom-Notifier\n\n## Overview\nEcom-Notifier is an ethical web scraping project designed to monitor price changes for a specific product on Amazon. When a price decrease is detected, the tool sends a notification to the user via the Pushover service.\n\n## Features\n- Monitor the price of a product on Amazon using its ASIN (Amazon Standard Identification Number).\n- Log the current price along with a timestamp.\n- Calculate the percentage difference between the current and previous prices.\n- Send notifications of price decreases using Pushover.\n- Uses Brightdata Web Unlocker proxy for handling web scraping.\n\n## Requirements\n- Python 3.12\n- Brightdata Web Unlocker proxy\n- Pushover account for notifications\n\n## Installation\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/yourusername/ecom-notifier.git\n    cd ecom-notifier\n    ```\n\n2. Create and activate a virtual environment:\n    ```sh\n    python3.12 -m venv venv\n    source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n    ```\n\n3. Install the required dependencies:\n    ```sh\n    pip install -r requirements.txt\n    ```\n\n4. Create a `.env` file in the root directory of the project and add your Brightdata and Pushover credentials:\n    ```env\n    PUSHOVER_TOKEN=your_pushover_token\n    PUSHOVER_USER=your_pushover_user\n    PROXY=your_brightdata_proxy\n    ```\n\n## Usage\n\n1. Set the ASIN of the product you want to monitor in the `main` function within `ecom_notifier.py`:\n    ```python\n    if __name__ == '__main__':\n        current_asin = \"B0B46N7QQL\"\n        main(current_asin)\n    ```\n\n2. Run the script:\n    ```sh\n    python ecom_notifier.py\n    ```\n\n## Functions\n\n### `write_price_to_file(price: int)`\nWrites the current price to a JSON file with a timestamp.\n\n### `get_price_difference(current_price: int) -\u003e int`\nCalculates the percentage difference between the previous and current prices.\n\n### `send_alert(message: str)`\nSends an alert message using the Pushover API.\n\n### `get_current_price(asin: str) -\u003e int`\nFetches the current price of a product from Amazon using its ASIN.\n\n### `main(asin: str)`\nMain function to check the current price of a product, calculate the difference from the previous price, write the current price to a file, and send an alert if the price has decreased.\n\n## Logging\nThe script uses the `loguru` library for logging. Logs are written to the console and to a rotating log file located at `logs/debug.log`.\n\n## Contributing\nContributions are welcome! Please open an issue or submit a pull request.\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Disclaimer\nThis project is intended for educational and ethical purposes only. Ensure you comply with Amazon's terms of service and scraping policies.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcecile-hirschauer%2Fecom-notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcecile-hirschauer%2Fecom-notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcecile-hirschauer%2Fecom-notifier/lists"}