A Twitter bot that tells you what government bills are up for debate daily.
The project uses the following technologies:
- Node
- Twitter API
- Axios
- Cron Job
The bot is scheduled to tweet out every morning using the Cron Job package. A new instance of the package then makes an Axios get request to the Canadian House of Commons API endpoint. It will then output the government bills scheduled for debate that day.
First, you'll need to sign up with Twitter's developer platform to get access to the API. Once you sign up, please note down the following four keys, which you will have to store in an environment file:
- API key
- API key secret
- Access token
- Access token secret
Then, after cloning the repo, please make sure to use install all the dependiencies using the following:
$ npm install
Store the four aforementioned keys in a .env file as four separate variables, as such:
TWITTER_API_KEY="INSERT VARIABLE HERE"
TWITTER_API_SECRET="INSERT VARIABLE HERE"
TWITTER_ACCESS_TOKEN="INSERT VARIABLE HERE"
TWITTER_ACCESS_TOKEN_SECRET="INSERT VARIABLE HERE"
Then use $ node app.js
in your terminal to spin up a local development server and you'll see the day's government bills tweeted out by your bot at 7 a.m. ET.
Tada!