Socket
Socket
Sign inDemoInstall

slackweatherbot

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    slackweatherbot

Search by location, bot gives you the weather


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
92.1 kB
Created
Weekly downloads
 

Readme

Source

slackweatherbot

Slack Weather Bot

Uses the Yahoo weather API via HTTPS to return the weather of a specified location/city to your Slack chat, using the RTM API.

Screenshot

Step 1

You first need this bot running on your Slack chat: https://github.com/xBytez/slackbotapi/

Step 2

Once you have your bot running off your script similar to example_bot.js on the xBytez repo, install the slackweatherbot via npm: (sudo) npm install slackweatherbot

Step 3

Require the module in your bot script:

var slackweatherbot = require('slackweatherbot');
weatherBot = new slackweatherbot();
Step 4

Within the switch statement place the following code:

case "weather":
    var location = command[1];
    weatherBot.getWeather(location, function (err, message) {
        if (message) slack.sendMsg(data.channel, message);
    });
    break;
Step 5

The module should work as per the screenshot above.

Keywords

FAQs

Last updated on 03 Nov 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc