Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

poblabs/slack-weatherbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Slack weatherbot

A bot for Slack that fetches weather data using the Outgoing Webhooks Custom Integrations.

I have this setup to listen on any Slack channel for "w" as the trigger word. Users can use the phrase "w 90210" to retrieve the weather from zip code 90210 using wunderground.com's public XML.

This bot requires:

  • Python untangle library (e.g. sudo pip install untangle)

Install

  • Copy both the weather.py and weather.php file to a public directory on your webserver.
  • Setup a new Outgoing WebHook in Slack (e.g. https://slack.com/apps > Configure > Custom Integrations > Outgoing WebHooks)
  • Set the channel to listen on
  • Set the Trigger Word to w
  • Set the URL to the public URL the weather.php (e.g. http://yourserver.com/slackbots/weather.php) file will reside
  • Copy the Token, we'll need this soon
  • Give it a label, and a username
  • Click Save
  • Open weather.php and enter your token into the $slack_token variable
  • Update the exec() path in weather.php to match the location of weather.py

Version

1.0 - Initial

Troubleshooting

  • Uncomment the syslog lines in both scripts to try and track down any issues.

I'm open to pull requests!

About

A bot for Slack that fetches weather data using the Outgoing Webhooks Custom Integrations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published