If you wish to run your own Twitter bot with this code, or your own version of it, you should have already set up a Twitter account and connected it to a Twitter Dev account to obtain your own consumer keys and access tokens that you will place on pibotconfig.js
. I have included an example of what this file should look like.
You will need node
and npm
installed on your machine.
Installation:
npm install
npm update
To Start:
npm start
If set up correctly, you should see the first tweet appear after a few seconds.
Pi1000 was a day long project I decided to build to learn more about Javascript, node and APIs.
Having jumped right into React and Angular after learning HTML and CSS without learning Javascript first, I knew I had to take a step back and reinforce the basics.
Since this was my first time working with an API, I decided to install the Twit
npm package to make my life a little bit easier first time around while working with the Twitter API. I also used a simple API to get the digits for Pi that you can read more about here.
I believe there are probably better ways to achieve what I have made here (I'm not even sure what will happen if the server goes offline for a few minutes), but I just wanted to test out the waters :)
In the end I had a lot of fun and learned a lot about all the technologies used.