{"id":16133098,"url":"https://github.com/aschuma/air_tweets","last_synced_at":"2025-10-09T09:38:57.309Z","repository":{"id":48414562,"uuid":"118373492","full_name":"aschuma/air_tweets","owner":"aschuma","description":"Stay informed on air quality with this simple bot, which posts real-time updates from a configurable sensor on the https://sensor.community network to Mastodon and Bluesky. See it in action by following #feinstaub and #cannstatt on  https://mastodon.online/@aschuma or https://bsky.app/profile/aschuma.bsky.social","archived":false,"fork":false,"pushed_at":"2025-07-08T18:46:03.000Z","size":697,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-03T22:38:34.444Z","etag":null,"topics":["air-quality","airrohr","bluesky-bot","bot","feinstaub","feinstaubalarm","luftdaten","mastodon","mastodon-bot","particulate-matter","pm10","python","sensor-data"],"latest_commit_sha":null,"homepage":"https://aschuma.github.io/air_tweets/","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/aschuma.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,"zenodo":null}},"created_at":"2018-01-21T21:00:01.000Z","updated_at":"2025-07-08T18:46:08.000Z","dependencies_parsed_at":"2023-09-21T20:14:59.131Z","dependency_job_id":"3c72ba27-80f7-4e7b-aa16-4cb45a630be0","html_url":"https://github.com/aschuma/air_tweets","commit_stats":{"total_commits":39,"total_committers":3,"mean_commits":13.0,"dds":"0.28205128205128205","last_synced_commit":"d005ffbf6ed17750d1d82d4df75edff0e3fa2cbb"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/aschuma/air_tweets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschuma%2Fair_tweets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschuma%2Fair_tweets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschuma%2Fair_tweets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschuma%2Fair_tweets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aschuma","download_url":"https://codeload.github.com/aschuma/air_tweets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschuma%2Fair_tweets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000713,"owners_count":26082894,"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-10-08T02:00:06.501Z","response_time":56,"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":["air-quality","airrohr","bluesky-bot","bot","feinstaub","feinstaubalarm","luftdaten","mastodon","mastodon-bot","particulate-matter","pm10","python","sensor-data"],"created_at":"2024-10-09T22:36:59.563Z","updated_at":"2025-10-09T09:38:57.291Z","avatar_url":"https://github.com/aschuma.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n  :::.       :::  :::::::..     ::::::::::::.::    .   .:::.,:::::: .,:::::::::::::::::: .::::::. \n  ;;`;;      ;;;  ;;;;``;;;;    ;;;;;;;;''''';;,  ;;  ;;;' ;;;;'''' ;;;;'''';;;;;;;;'''';;;`    ` \n ,[[ '[[,    [[[   [[[,/[[['         [[      '[[, [[, [['   [[cccc   [[cccc      [[     '[==/[[[[,\nc$$$cc$$$c   $$$   $$$$$$c           $$        Y$c$$$c$P    $$\"\"\"\"   $$\"\"\"\"      $$       '''    $\n 888   888,  888   888b \"88bo,       88,        \"88\"888     888oo,__ 888oo,__    88,     88b    dP\n YMM   \"\"`   MMM   MMMM   \"W\"        MMM         \"M \"M\"     \"\"\"\"YUMMM\"\"\"\"YUMMM   MMM      \"YMmMY\"                                         \n \n```\n# Tweets air quality measurement results of particulate matter (Feinstaub) (http://luftdaten.info)\n\nThis source code is for a Mastodon / Bluesky bot that monitors particulate matter (Feinstaub) for a single sensor from the https://sensor.community network. The bot will automatically publish a tweet when the PM10 particulate matter exceeds a configurable threshold, such as 50 µg/m³.\"\n\nA tweet might look like this:\n\n\u003cimg width=\"482\" height=\"388\" src=\"https://github.com/aschuma/air_tweets/raw/main/tweet-screnshot.png\"\u003e\n\nThis repository provides a cron job written in python 3. After a tweet submission no further tweets\nare created for a configurable period.\n\n# Installation\n\n- Create a Mastodont account, obtain an access token, see https://docs.joinmastodon.org/client/token for further details.\n- Make sure python 3 is installed on your dev machine.\n- Clone this repository\n- Create a virtual environment, you may obtain more information about the steps below here: http://docs.python-guide.org/en/latest/dev/virtualenvs/ \n   ```\n   virtualenv venv -p /usr/bin/python3\n   source venv/bin/activate\n   pip3 install -r requirements.txt \n   ```\n   \n- Copy the file ```config.py-template``` to ```config.py```, adjust the setup. At least you should alter the following values as starting point.\n\n   ```\n  # database, last tweet timestamp\n  conf_storage = \"/tmp/.air_tweet\"\n\n  # the sensor IDs (temperature is optional. If you provide an ID, consider updating the templates accordingly)\n  conf_particle_sensor_id = 90887\n  conf_temperature_sensor_id = None\n\n  # url used to fetch the avg sensor of the last hour\n  [..]\n\n  # sensor graph grafana image to embed in the tweet (optional)\n  #   conf_luftdaten_graph_url = \"http://192.168.0.43:3000/render/d-solo/eDF152mRk/twitter?panelId=2\u0026orgId=1\u0026from={}\u0026to={}\u0026width=800\u0026height=500\u0026tz=UTC%2B02%3A00\"\n  conf_luftdaten_graph_url = None\n  conf_luftdaten_graph_mime_type = \"image/png\"\n\n  # PM 10 limit\n  conf_limit_pm_10_0 = 50\n\n  # stuff to embed in the tweet - link to sensor community map\n  conf_luftdaten_map_url = \"https://maps.sensor.community/#15/48.8040/9.2280\"\n\n  # quiet period after a tweet has been published\n  conf_quiet_period_in_hours = 6\n\n  # mastodon credentials\n  mastodon_enabled = True\n  mastodon_api_base_url = 'https://mastodon.online' \n  mastodon_access_token =  ''\n\n  # bluesky credentials\n  bluesky_enabled = False\n  bluesky_handle = '....bsky.social'\n  bluesky_password = '...'\n\n  [..]\n   ```\n\n- Setup a cron job\n\n  ```\n  */15 * * * * cd /home/pi/projects/air_tweets \u0026\u0026 venv/bin/python tweet.py \u003e /dev/null 2\u003e\u00261\n  ```\n\n# Contribution\n\nPlease feel free to issue a bug report or submit a PR. Any helping hand is welcome. \n\nBe aware that my primary coding language is Java. So currently some code portions might not follow python best practices.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faschuma%2Fair_tweets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faschuma%2Fair_tweets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faschuma%2Fair_tweets/lists"}