Skip to content

Serverless Twitter bot which tweets out goals from the 2018 FIFA World Cup

License

Notifications You must be signed in to change notification settings

jthomas/goalbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

World Cup 2018 Goal Bot - 🌍🏆⚽️🤖

Serverless Twitter bot which tweets out goals from the 2018 FIFA World Cup.

Serverless application built using IBM Cloud Functions (Apache OpenWhisk).

Powers the WC2018 Goals Twitter account.

World Cup Goal Tweet

architecture

This project has two serverless functions goal_tracker and twitter.

goal_tracker is connected to an alarm trigger running every sixty seconds. It retrieves all goals for live matches using this API. If new goals are returned, it invokes the goal trigger with details.

twitter is connected to the goal trigger. It takes goal events and sends new tweets using the Twitter API.

Redis is used to cache goals previously seen by the goal_tracker function.

installation

If you want to deploy this project you will need an instance of the Apache OpenWhisk platform, access to a Redis database and credentials for a Twitter application.

setup

  • Install The Serverless Framework.

    npm install serverless
    
  • Clone Git repository.

    git clone https://github.com/jthomas/goalbot.git
    
  • Install project dependencies.

    cd goalbot && npm install
    
  • Create authentication credential for Redis and Twitter in creds.json file.

    {
      "redis": { 
        "host": "XXX",
        "port": "XXX",
        "password": "XXX"
      },
      "twitter": {
        "consumer_key": "XXX",
        "consumer_secret": "XXX",
        "access_token_key": "XXX",
        "access_token_secret": "XXX"
      }
    }
    
  • Run the deploy command.

    serverless deploy
    

About

Serverless Twitter bot which tweets out goals from the 2018 FIFA World Cup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published