{"id":19099826,"url":"https://github.com/bryanoliveira/python-availability-bot","last_synced_at":"2026-05-14T01:40:57.886Z","repository":{"id":40467551,"uuid":"326681173","full_name":"bryanoliveira/python-availability-bot","owner":"bryanoliveira","description":"A Python bot that checks a list of sites for product availability and sends alerts via webhooks.","archived":false,"fork":false,"pushed_at":"2022-05-06T12:32:52.000Z","size":23505,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-31T17:55:11.126Z","etag":null,"topics":["bot","python","selenium"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bryanoliveira.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}},"created_at":"2021-01-04T12:45:59.000Z","updated_at":"2022-12-14T04:18:49.000Z","dependencies_parsed_at":"2022-08-09T21:20:36.895Z","dependency_job_id":null,"html_url":"https://github.com/bryanoliveira/python-availability-bot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bryanoliveira/python-availability-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanoliveira%2Fpython-availability-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanoliveira%2Fpython-availability-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanoliveira%2Fpython-availability-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanoliveira%2Fpython-availability-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bryanoliveira","download_url":"https://codeload.github.com/bryanoliveira/python-availability-bot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanoliveira%2Fpython-availability-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33006810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bot","python","selenium"],"created_at":"2024-11-09T03:52:18.749Z","updated_at":"2026-05-14T01:40:57.864Z","avatar_url":"https://github.com/bryanoliveira.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Availability Bot\n\nA Python bot that checks a list of sites for product availability and sends alerts via webhooks (e.g. Discord or Slack).\n\n## Usage\n\n- Clone this repository\n- Set the WEBHOOK_ALERT and WEBHOOK_PULSE environment variables (using [Slack](https://api.slack.com/messaging/webhooks), or [Discord](https://discord.com/developers/docs/resources/webhook#execute-webhook))\n- Download a browser driver compatible with the one you have installed [here](https://www.selenium.dev/downloads/#platforms-supported-by-selenium)\n- Edit the bot.py script changing the web driver's path to the one you downloaded\n- Install [Python 3](https://www.python.org/downloads/)\n- Install the requirements: `pip install -r requirements.txt`\n- Run the script: `./bot.sh`\n\n## Context\n\nNVidia's RTX 30 series cards were released mid-2020, during the COVID-19 pandemic.\nFor that reason, supply chains were slow and demand for home-office hardware rose up, resulting in very low stock available for those items.\nIn the mentioned stores, we had something like 5 units per week, made available at random hours during the days.\nTo release me from constantly pressing F5 in these stores' GPU sections, I made this bot.\n\n## How it works\n\nThis bot uses [Selenium](https://www.selenium.dev/) to launch a Chrome instance, access the pages I configured and look for a \"buy\" button.\nIf the button is found, it plays a sound (in case I'm not using the computer; e.g. Kabum updates it's stock at 3 a.m. every day) and sends a message to my Slack\nnotifications channel, which then vibrates my smartwatch.\n\nAs many other websites, these stores try to identify and block bots.\nAs a workaround, I removed the automation flag from the Selenium driver's request headers and a new UserAgent header is generated at every loop iteration.\nI also added a random sleep time between requests and used the same browser instance to access sequentially all the stores, so the history is carried\n(in case any store checks it).\nI opted to use the actual browser instance in case a Captcha was required, so I could solve it manually before the bot could loop indefinitely\n(Terabyteshop asks the user to solve a Captcha only once in a session).\n\nEven with all the workarounds, the loop may still fail for some unknown (to me) reason.\nWhen this happens, a browser instance may be left open and blow up the memory if it repeats this behavior too much.\nTo address this I added a graceful exit procedure that, combined with a timeout method, allows the script to cleanly exit.\nI also wrapped the python script execution with a shell script that loops restarting the process if it exits unexpectedly.\n\nFinally, the bot also sends a \"pulse\" to slack (in a silenced channel) to indicate that it is still running.\nI added this after I lost a chance to buy a card due to an uncaught timeout crash in the first day.\n\n## Conclusion\n\nThis bot actually helped me buy the card I wanted for a fair price in 2020 :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanoliveira%2Fpython-availability-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbryanoliveira%2Fpython-availability-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanoliveira%2Fpython-availability-bot/lists"}