{"id":17928571,"url":"https://github.com/alifeee/pollen_bot","last_synced_at":"2025-08-15T15:33:39.682Z","repository":{"id":175030023,"uuid":"653176930","full_name":"alifeee/pollen_bot","owner":"alifeee","description":"A telegram bot to notify you when the pollen count is high, using the UK's Met Office Pollen Forecast (UK only)","archived":false,"fork":false,"pushed_at":"2025-03-18T00:36:56.000Z","size":209,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-11T03:34:47.819Z","etag":null,"topics":["forecast","met-office","pollen","telegram-bot"],"latest_commit_sha":null,"homepage":"https://t.me/pollen_count_bot","language":"HTML","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/alifeee.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}},"created_at":"2023-06-13T14:43:13.000Z","updated_at":"2025-03-18T00:37:00.000Z","dependencies_parsed_at":"2024-03-30T18:01:00.393Z","dependency_job_id":null,"html_url":"https://github.com/alifeee/pollen_bot","commit_stats":null,"previous_names":["alifeee/pollen_bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alifeee/pollen_bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fpollen_bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fpollen_bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fpollen_bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fpollen_bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alifeee","download_url":"https://codeload.github.com/alifeee/pollen_bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alifeee%2Fpollen_bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270587089,"owners_count":24611467,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["forecast","met-office","pollen","telegram-bot"],"created_at":"2024-10-28T21:04:08.313Z","updated_at":"2025-08-15T15:33:39.276Z","avatar_url":"https://github.com/alifeee.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pollen bot\n\nThis is a Telegram bot, to send you a message every time the pollen threshold reaches above a certain level.\n\nIt uses the [Met Office's pollen forecast](https://www.metoffice.gov.uk/weather/warnings-and-advice/seasonal-advice/pollen-forecast)\n\nMessage \u003chttps://t.me/pollen_count_bot\u003e on Telegram to use.\n\n## Requirements\n\n| Requirement | Version |\n| ----------- | ------- |\n| Python      | 3.11.1  |\n\n## Commands\n\n### Set up environment\n\n```bash\npip install -r requirements.txt\n```\n\n### Run\n\n```bash\npython bot.py\n```\n\n### Run and run scheduled tasks on startup\n\n```bash\npython bot.py start\n```\n\n## Telegram credentials\n\nTo obtain an access token for telegram, see [help page](https://github.com/python-telegram-bot/python-telegram-bot/wiki/Introduction-to-the-API), but in essence, talk to the [BotFather](https://t.me/botfather).\n\nThe access token is used via an environment variable, or a `.env` file, which is not tracked by git.\n\nAlso in the environment should be an \"admin ID\", where errors are sent via the error handler.\n\n```bash\ntouch .env\n```\n\n```.env\nTELEGRAM_BOT_ACCESS_TOKEN=...\nADMIN_USER_ID=...\n```\n\n## Persistent data\n\nTo store each user's location, reminder preference, and reminder threshold, a persistent pickle file is used. This is not tracked by git. This uses the [Persistence API](https://github.com/python-telegram-bot/python-telegram-bot/wiki/Making-your-bot-persistent) from [python-telegram-bot][ptb].\n\n[ptb]: https://github.com/python-telegram-bot/python-telegram-bot/\n\n```python\npersistent_data = PicklePersistence(filepath=\"bot_data.pickle\")\napplication = Application.builder().token(API_KEY).persistence(persistent_data).build()\n```\n\n## Deploy on remote server\n\n### Set up environment on server (Linux)\n\n```bash\nssh alifeee@...\nsudo apt-get update\nsudo apt install python3.11-venv\nsudo mkdir -p /usr/alifeee\nsudo chown alifeee:alifeee /usr/alifeee\ncd /usr/alifeee\ngit clone git@github.com:alifeee/pollen_bot.git\nsudo adduser --system --no-create-home --group pollen_bot\n# sudo cat /etc/group\n# sudo cat /etc/passwd\n# sudo -u pollen_bot whoami\npython3 -m venv env\n./env/bin/pip install -r requirements.txt\nsudo chown -R alifeee:pollen_bot .\n```\n\n### Move over secrets\n\n```bash\nscp .env alifeee@...:~/python/pollen_bot/\nsudo chown -R alifeee:pollen_bot .env\n```\n\n### Set up to run as a process\n\n#### With systemd\n\n```bash\ncp pollen_bot.service /etc/systemd/system/pollen_bot.service\nsudo systemctl enable pollen_bot.service\nsudo systemctl start pollen_bot.service\nsudo systemctl status pollen_bot.service\n```\n\n#### With runit\n\n[`runit`](https://smarden.org/runit/) is a bit like systemd. See [FAQ](https://smarden.org/runit/faq).\n\n```bash\nmkdir /home/alifeee/python/pollen_bot/logs\nsudo mkdir /etc/sv/pollen_bot\nsudo echo '#!/bin/sh\n  #cd /home/alifeee/python/pollen_bot \u0026 ./env/bin/python3 bot.py\n  # redirect stderr to stdout\n  exec 2\u003e\u00261\n  # start program\n  exec /home/alifeee/python/pollen_bot/env/bin/python3 /home/alifeee/python/pollen_bot/bot.py\n  ' \u003e /etc/sv/pollen_bot/run\nsudo mkdir /etc/sv/pollen_bot/log\nsudo echo '#!/bin/sh\n  exec svlogd -tt /home/alifeee/python/pollen_bot/logs\n  ' \u003e /etc/sv/pollen_bot/log/run\nsudo ln -s /etc/sv/pollen_bot /etc/service/\n\nsudo sv start pollen_bot\nsudo sv stop pollen_bot\nsudo sv status pollen_bot\nsudo sv restart pollen_bot\n```\n\n#### Logs\n\nLog files are stored in the folder specified above, so for this script, they are in `~/python/pollen_bot/logs`.\n\n### Update\n\n```bash\nssh alifeee@...\ncd ~/python/pollen_bot\ngit pull\nsudo sv restart pollen_bot\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falifeee%2Fpollen_bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falifeee%2Fpollen_bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falifeee%2Fpollen_bot/lists"}