All Projects → BrianMitchL → weatherBot

BrianMitchL / weatherBot

Licence: MIT License
⛈ A Twitter bot for weather

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to weatherBot

DarkSkyKit
DarkSky.net API client written in Swift.
Stars: ✭ 33 (+65%)
Mutual labels:  weather, darksky
darksky
Forecast.io API wrapper in Go (Golang)
Stars: ✭ 74 (+270%)
Mutual labels:  weather, darksky
booster
twitter bot that builds followers
Stars: ✭ 30 (+50%)
Mutual labels:  twitter-bot, twitter
awesome-twitter-bots
A Curated Collection of the Best Twitter Bots 🤖
Stars: ✭ 99 (+395%)
Mutual labels:  twitter-bot, twitter
Jupiter
🌞 The Swift Weather Framework
Stars: ✭ 14 (-30%)
Mutual labels:  weather, darksky
Twitter-bot
Twitter bot which waits for #hashTag and sends weather update of city via tweets
Stars: ✭ 20 (+0%)
Mutual labels:  weather, twitter-bot
MMM-forecast-io
Forecast.io Module for MagicMirror
Stars: ✭ 58 (+190%)
Mutual labels:  weather, darksky
epaper-clock-and-more
e-paper clock + weather + AQI + traffic delays - using Waveshare 2.7inch & 4.2inch eink displays running on Raspberry Pi
Stars: ✭ 34 (+70%)
Mutual labels:  weather, darksky
darksky-influxdb
Logs weather information from darksky.io to InfluxDB
Stars: ✭ 22 (+10%)
Mutual labels:  weather, darksky
himawari bot
Code that runs the twitter.com/himawari8bot bot.
Stars: ✭ 14 (-30%)
Mutual labels:  twitter-bot, twitter
swappy-one
swappy.one
Stars: ✭ 24 (+20%)
Mutual labels:  twitter
ioBroker.dwd
Fetches weather warnings from "Deutscher Wetterdienst" (germany only)
Stars: ✭ 19 (-5%)
Mutual labels:  weather
TwitterPiBot
A Python based bot for Raspberry Pi that grabs tweets with a specific hashtag and reads them out loud.
Stars: ✭ 85 (+325%)
Mutual labels:  twitter
sentiment-thermometer
Measure the sentiment towards a word, name or sentence on social networks
Stars: ✭ 56 (+180%)
Mutual labels:  twitter
ror-capstoneproject
A solo project to finish the Ruby on Rails module. This project uses the knowledge of Ruby, Ruby on Rails, Postgres, Devise, ActiveStorage, Cloudinary, RSpec, and Capybara.
Stars: ✭ 12 (-40%)
Mutual labels:  twitter
vim-twitter
Tweet from inside vim!
Stars: ✭ 26 (+30%)
Mutual labels:  twitter
twitter-stream-api
Consume the Twitter Stream API in real-time.
Stars: ✭ 19 (-5%)
Mutual labels:  twitter
mention-hashtag
Extract mentions (@mention) or hashtags (#hashtag) from any text
Stars: ✭ 16 (-20%)
Mutual labels:  twitter
stay-productive
Remove feed from Facebook, Twitter and Linkedin... To stay productive !
Stars: ✭ 15 (-25%)
Mutual labels:  twitter
climateR
An R 📦 for getting point and gridded climate data by AOI
Stars: ✭ 93 (+365%)
Mutual labels:  weather

weatherBot GitHub release Python Version Build Status Coverage Status

A Twitter bot for weather. Powered by Dark Sky.

Powered by Dark Sky

Note: Any language or wording suggestions are appreciated and should be submitted as an issue or pull request.

Example bots can be found at @MorrisMNWeather and @WeatherByBrian.

weatherBot tweets the current weather condition at scheduled times. If a special weather event is happening, it will tweet that (outside of the scheduled times). weatherBot can also tweet the current day's forecast.

Features

  • Current conditions at scheduled times
  • Daily forecast at a scheduled time
  • Severe weather alerts issued by a governmental authority
  • Real time "special" events (precipitation, fog, extreme temperatures, wind, etc.)
  • Granular throttling of special events
  • Variable location for all tweets based on the locations of a user's recent tweets
  • Fully customizable text for tweets via a YAML file
  • International support for timezones, units, and languages
  • Twitter geolocation in each tweet
  • Console and file based logging
  • Send the traceback of a crash as a direct message
  • Cache runtime information to a file for easy resuming
  • Configuration file
  • Deploy via Heroku or Docker

Install Dependencies

Run the following from the repository root directory to install the needed dependencies.

# The minimum dependencies needed to run weatherBot
pip3 install -r requirements.txt
# Additional dependencies needed for testing, linting, and validating
pip3 install -r requirements-dev.txt

Use

weatherBot.py has been built for Python 3 (tested with 3.6 and above). Legacy Python is not supported.

  1. Set your location and other settings in weatherBot.conf
  2. Set your API keys and secrets as environmental variables (recommended) or in keys.py
python3 weatherBot.py weatherBot.conf

You're all set!

Settings and Customizing

Configuration File

Many features of weatherBot can be customized in a conf file, using the INI configuration format. This ships with a file named weatherBot.conf, but can be called whatever you'd like. Each option has a comment above it describing its purpose. By default, each option is commented out with a semi-colons (;). This shows the default value and provides an example of a valid configuration.

If you want a clean conf file, feel free to remove all but the settings you set, they are all optional. The section headers must remain in the file.

API Keys

The Twitter app consumer key and secret as well as the access token and token secret are located either in environmental variables (recommended) or in the keys.py file. The script will pull in the keys from the environmental variables over the keys.py file. See https://apps.twitter.com to get your keys and secrets. The names of the environmental variables are as follows: WEATHERBOT_CONSUMER_KEY, WEATHERBOT_CONSUMER_SECRET, WEATHERBOT_ACCESS_TOKEN, WEATHERBOT_ACCESS_TOKEN_SECRET, and WEATHERBOT_DARKSKY_KEY. Entering keys into keys.py is not required if you have entered them as environmental variables.

Strings

The language as well as the text used for all tweets can be edited or added in strings.yml. Remember to set the units and path/filename (defaults to strings.yml) in the configuration file.

Variable Location

Enable variable location to have the location for weather change. The Twitter username in the variable location user setting will be used to determine this location. The specified user must tweet with location fairly regularly (at least every 20 tweets, not including retweets), or the manually entered location will be used. The most recent tweet with a location will be used to get the location for weather. For example, say the given user tweets from Minneapolis, MN one day. Minneapolis will be used as the location indefinitely until a new tweet with location is posted or if 20 new tweets have been posted that do not contain a location. weatherBot checks the user's timeline every 30 minutes for updates in location. The human readable Twitter location will also be added to the beginning of each tweet. For example, in the same case as earlier, "Minneapolis, MN: " would be prefixed to every tweet.

Deploying

Head over to the wiki for some examples of deploying weatherBot.

Task Runner

The following tasks are available through invoke.

  • invoke lint
Docstring:
  Use PyLint to check for errors and enforce a coding standard.
  This will, by default, use the PyLint configuration found in '.pylintrc',
  but can accept a different path.

Options:
  -e STRING, --extra=STRING      Extra Python files to lint in addition to the
                                 default.
  -p STRING, --pylintrc=STRING   Path to a pylintrc file for configuring
                                 PyLint.

  • invoke clean
Docstring:
  Clean (delete) files. If passed with no arguments, nothing is deleted.

Options:
  -b, --bytecode              Remove bytecode files matching the pattern
                              '**/*.pyc'.
  -c, --cache                 Remove the '.wbcache.p' file.
  -e STRING, --extra=STRING   Remove any extra files passed in here.
  • invoke validateyaml
Docstring:
  Use yamllint to check for errors and enforce a markup standard for the strings YAML file.
  By default this will use the '.yamllint' config file to validate 'strings.yml'.

Options:
  -f STRING, --filename=STRING     Path to the strings YAML file to validate.
  -y STRING, --yamllintrc=STRING   Path to a yamllintrc file for configuring
                                   PyLint.
  • invoke test
Docstring:
  Runs tests and reports on code coverage.
  Keys need to be entered in 'keys.py' or set as environmental variables.

Options:
  -r, --report   Flag to print a coverage report

Tools Used

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].