Code Monkey home page Code Monkey logo

weatherbot's Introduction

Weather Bot

Just simple example of flex message from LINE Messaging API with Redis for caching state. This bot using OpenWeatherMap for data source of weather forecast.

Forecast GIF

Table of Contents

  1. Requirements
  2. Preparation
  3. Get Started
  4. Folder Structure
  5. Available Commands
  6. How to Contribute
  7. License

Requirements

Preparation

  • Create and define .env file based on .env.example
  • Create LINE Messaging API, get the channel secret and channel access token in Channel settings tab and put that in .env
  • Create account or login in OpenWeatherMap, get the API key and put that in .env
  • Run your Redis server

Get Started

  • Run npm install for install all dependencies
  • Run npm run serve for development or npm start for production phase
  • Publish or deploy webhook and update the Webhook URL field in your settings of LINE Messaging API.

NOTE. Just take a look /src/controllers directory and /src/chatbot.js module if you want update/add something.

Folder Structure

/dist             # scripts that have been built
/src
  /controllers    # all functional commands
  /utils          # maybe you need this ¯\_(ツ)_/¯
  chatbot.js      # main module for chatbot
  index.js        # main routing app

Available Commands

  • /start: View all menu in bot
  • /current: View current weather based on specific location
  • /forecast: View forecast weather based on specific location

How to Contribute

  • Create an issue
  • Fork this repository to your GitHub account
  • Make changes
  • Create pull request to this repository

License

MIT

MIT

weatherbot's People

Contributors

mgilangjanuar avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.