{"id":21921438,"url":"https://github.com/firelemons/twitterweatherbot","last_synced_at":"2026-05-01T02:33:40.573Z","repository":{"id":40933301,"uuid":"160885962","full_name":"FireLemons/TwitterWeatherBot","owner":"FireLemons","description":"My personal weather bot","archived":false,"fork":false,"pushed_at":"2022-12-08T07:36:46.000Z","size":887,"stargazers_count":1,"open_issues_count":19,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T18:47:41.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/FireLemons.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":"2018-12-07T23:34:12.000Z","updated_at":"2021-03-10T02:03:20.000Z","dependencies_parsed_at":"2023-01-25T09:01:03.891Z","dependency_job_id":null,"html_url":"https://github.com/FireLemons/TwitterWeatherBot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/FireLemons/TwitterWeatherBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FireLemons%2FTwitterWeatherBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FireLemons%2FTwitterWeatherBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FireLemons%2FTwitterWeatherBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FireLemons%2FTwitterWeatherBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FireLemons","download_url":"https://codeload.github.com/FireLemons/TwitterWeatherBot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FireLemons%2FTwitterWeatherBot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32483406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":[],"created_at":"2024-11-28T20:24:52.734Z","updated_at":"2026-05-01T02:33:40.558Z","avatar_url":"https://github.com/FireLemons.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TwitterWeatherBot\nMy personal twitter weather bot\n\nBasic features:  \n+ Tweet a forecast for the near future every 2 hours  \n+ Add a random weather fact to the 2 hour forecast  \n+ Tweet alerts from the NWS  \n+ Retweet all tweets from the local weather station\n  \n## Configuration  \n### Required:  \n#### Logging  \nSet the dierctory path where logs will be stored.\nPaths are relative to `index.js`.  \n\n    \"log\": {\n      \"logDir\": \"logs\"\n    }\n  \n#### Open Weather Map  \nThe forecast area is set `config.weather.openWeatherMap.location` using one of these combinations.  \n\n - City Name  \n`q: \"{city name},{country code}\"`  \n - City ID  \nA list of city ids can be [downloaded here](http://bulk.openweathermap.org/sample/city.list.json.gz).  \n`id: {city id}`  \n - Geographic Coordinates  \n`lat: {lat}`  \n`lon: {lon}`  \n - Zip Code  \n`zip: \"{zip code},{country code}\"`\n\nset `config.weather.openWeatherMap.key` to the openWeatherMap api key  \n  \nExample\n\n    \"weather\":{\n      \"openWeatherMap\": {\n        \"location\": {\n          \"id\": 4381982\n        },\n        \"key\": \"API KEY\"\n      }\n    }\n\n#### Twitter  \n`config.twitter` contains keys generated from the twitter developer account.\n\n    \"twitter\": {\n      \"consumer_key\": \"CONSUMER KEY\",\n      \"consumer_secret\": \"CONSUMER SECRET\",\n      \"access_token_key\": \"ACCESS TOKEN KEY\",\n      \"access_token_secret\": \"ACCESS TOKENM SECRET\"\n    }\n\n### Optional Configuration:  \n#### Alerts  \nAlerts are sent out at midnight, 6:00, noon, and 18:00.  \nAlert requests must contain an email, app name, app version, and a website in the header. These are set in `config.weather.alerts.app`  \n`weather.alerts.params` will contain get parameters to send to api.weather.gov/alerts. The NWS has a request testing tool [here](https://www.weather.gov/documentation/services-web-api#/default/get_alerts) under the \"Specification\" tab.\n  \nExample:\n\n    \"weather\": {\n      \"alerts\": {\n        \"disabled\": false,\n        \"app\": {\n          \"contact\": \"yourEmail@example.com\",\n          \"name\": \"AppName\",\n          \"version\": \"0.1\",\n          \"website\": \"www.yourWebsite.com\"\n        },\n        \"params\": {\n          \"active\": true,\n          \"area\": \"MO\",\n          \"status\": \"actual\"\n        }\n      }\n    }\n\n##### Alert Filters  \n  \nFilters are in the form:  \n\n    {\n      \"restriction\":\"FILTER TYPE\",\n      \"path\": \"PATH TO VALUE\",\n      \"value\": \"VALUE FOR FILTERING\",\n      \"keep\": true\n    }\n\nwhere  \n - restriction is the type of filter\n - path is the path in the alert object to the value to be filtered\n - value will be different depending on the filter type\n - keep is true if all alerts matching the filter are to be kept and false if all alerts not matching the filter are to be kept\n  \nAvailable filter types:  \n - after  \n Matches alerts with dates after and excluding the time *t* when alerts are tweeted  \n value is a number of hours to offset *t*  \n - before  \n Matches alerts with dates before and excluding the time *t* when alerts are tweeted  \n value is a number of hours to offset *t*  \n - contains  \n Matches alerts with arrays containing VALUE\n value is an element of an array to be searched for. it must be a primitive value  \n - has  \n Matches alerts where PATH in the object exits  \n value is not needed  \n The has filter is always used first\n - equals  \n Matches alerts with VALUE exactly equal to the value at path  \n value is a primitive value to be compared with using strict equality  \n - matches  \n Matches alerts with strings matching a regex pattern  \n value contains a regex string  \n   \nFilters go in an array at config.weather.alerts.filters.  \n  \nExample:  \nKeep all alerts where \"Boone;\" or \"Boone, MO\" is used to describe the area and discard all alerts that have been replaced by another alert.  \n\n    \"weather\": {\n      \"alerts\": {\n        ...\n        \"filters\": [\n          {\n            \"restriction\": \"matches\",\n            \"path\": \"properties.areaDesc\",\n            \"value\": \"Boone;|Boone, MO;\",\n            \"keep\": true\n          },\n          {\n            \"restriction\": \"has\",\n            \"path\": \"properties.replacedBy\",\n            \"keep\": false\n          }\n        ]\n      }\n    }\n\n#### Extra Messages  \nExtra messages are appended at the end of every forecast tweet. They give additional weather information and are picked at random.  \n  \nExtra messages require coordiantes to work.  \n`config.extra.coordinates.elevation` is the elevation in meters  \n`config.extra.coordinates.long` is the longitude west(west is negative, east is positive)  \n`config.extra.coordinates.lat` is the north latitude(north is positive, south is negative)  \n\nExample:\n\n    \"extra\":{\n      \"coordinates\": {\n        \"elevation\": 231,\n        \"long\": -92.3341,\n        \"lat\": 38.9517\n      },\n      ...\n    }\n  \nThe avaialable message types are  \n - __joke__ Fetches a random joke from `data/jokes.json`'s \"general\" array\n - __tutorial__ Mostly tells what weather conditions forecast icons correspond to.\n - __lunar__ Tells the current phase of the moon\n - __season__ Tells the number of days between the latest solstice/equinox and the next solstice/equinox\n - __sunrise__ At day tells sunset and sunrise times and day length. At night tells last sunset and next sunrise and night length.\n - __beaufort__ Describes the current wind speed using the [Beaufort scale](https://en.wikipedia.org/wiki/Beaufort_scale)\n - __records__ Tells the hottest temperature, the coldest temperature, or the most precipitation that has ever occoured on the current day of the year.\n - __cloudiness__ Forecasted %cloudiness for the next 9 hours same as the main forecast\n - __humidity__ Forecasted %humidity for the next 9 hours same as the main forecast\n - __precipitation__ Forecasted precipitation in mm for the next 9 hours same as the main forecast. If there is no precipitation cloudiness, humidity, or pressuire is displayed instead.\n - __pressure__ Forecasted pressure in hectopascals for the next 9 hours same as the main forecast.  \n  \nThe probability of each type of message showing up is set by a weight. The probability of a message type showing up is its weight / sum of all weights.  \n  \nSetting all weights to 0 and having extras enabled causes an error.  \n  \nExample:  \nThe sum of all the weights is 100. Jokes have 1/100 chance of showing up. Moon phase messages have a 15/100 chance of showing up.\n\n    \"extra\":{\n      ...\n      \"probabilities\":{\n        \"joke\": 1,\n        \"tutorial\": 9,\n        \"lunar\": 15,\n        \"season\": 5,\n        \"sunrise\": 15,\n        \"beaufort\": 10,\n        \"records\": 0,\n        \"cloudiness\": 10,\n        \"humidity\": 10,\n        \"precipitation\": 15,\n        \"pressure\": 10\n      }\n    }\n\nExtras can be disabled with:  \n\n    \"extra\":{\n      \"disabled\": true,\n      ...\n    }\n\n#### Retweets  \n`config.twitter.localStationHandle` can be set to a local weather station's twitter handle to retweet all their tweets every hour on the 30 minute mark.  \n  \nExample:  \n\n    \"twitter\": {\n      ...\n      \"localStationHandle\": \"NWSStLouis\"\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirelemons%2Ftwitterweatherbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirelemons%2Ftwitterweatherbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirelemons%2Ftwitterweatherbot/lists"}