Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
/ weather-bot Public archive

A LINE chat bot for querying current weather.

Notifications You must be signed in to change notification settings

0140454/weather-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Bot

A LINE chat bot for querying current weather.

Requirements

  • Python 3
    • Django (Django)
    • gunicorn (gunicorn)
    • SDK for LINE Messaging API (line-bot-api)
    • SDK for Google api.ai (apiai)

How to build this bot

  1. Setup secret information

    There are two ways to reach it.

    • Using environment variables
    export SECRET_KEY='SECRET_KEY'
    export CWB_AUTHED_KEY='CWB_AUTHED_KEY'
    export LINE_CHANNEL_SECRET='LINE_CHANNEL_SECRET'
    export LINE_CHANNEL_ACCESS_TOKEN='LINE_CHANNEL_ACCESS_TOKEN'
    export API_AI_CLIENT_ACCESS_TOKEN='API_AI_CLIENT_ACCESS_TOKEN'
    • Write secret to weather_bot/secret.py
    SECRET_KEY = 'SECRET_KEY'
    CWB_AUTHED_KEY = 'CWB_AUTHED_KEY'
    LINE_CHANNEL_SECRET = 'LINE_CHANNEL_SECRET'
    LINE_CHANNEL_ACCESS_TOKEN = 'LINE_CHANNEL_ACCESS_TOKEN'
    API_AI_CLIENT_ACCESS_TOKEN = 'API_AI_CLIENT_ACCESS_TOKEN'
  2. Modify ALLOWED_HOSTS in weather_bot/settings.py

    ALLOWED_HOSTS = [
        'YOUR_HOST'
    ]
  3. Deploy this web application in HTTPS server

    You may use Heroku to help you get HTTPS URL.

  4. Go to LINE Bot setting page

    Fill callback url for bot in Webhook URL field.

    (e.g. https://YOUR_HOST/service/callback/)

Reference

About

A LINE chat bot for querying current weather.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages