This bot returns specific number of tweets (as configured in app.js) for a specified search query (specified in app.js) then retweets each of the returned tweets.
- Star and download the repository
- run
npm install
to install the needed dependencies - Copy the file
config.default.js
, rename it toconfig.js
and then change its values - this file will store the configuration details for the Twitter API.
The structure should be the following:
module.exports = {
consumer_key: '',
consumer_secret: '',
access_token_key: '',
access_token_secret: ''
}
- Visit the Twitter API and fill out the form to create a new app (You will need a developer's account on twitter for this). When done, click on the Keys and Access Tokens tab to view your consumer key/secret and access token key/secret. Copy these keys/secrets into your
config.js
file. - In
app.js
you can edit theparams
variable to determine what to search for:
var params = {
q: 'SEARCH_QUERY_HERE', //search query
count: 10, //number of tweets to return
result_type: 'recent', //shows recent tweets
lang: 'en' //language English
}
- Now we're ready! Open up the command prompt and type
npm start
to run the application.