This is a sample command line application used in the JSReadme blog post. This cli app performs twitter search. This is meant to demonstrate how to build a cli app using Node.js.
Install the packages using NPM
npm install
Register for a Twitter app at Twitter Developers. Generate an access token for the app.
Once done, copy the configuration file to a new file called configuration.json
cp config/configuration.example.json config/configuration.json
Fill in the credentials on configuration.json.
Running without any arguments brings you to a prompt
node bin/birdie
prompt: query
Type in your search query and press enter. You should see the search results returned in JSON format.
You can also pass in arguments. Arguments are assumed to be the query.
node bin/birdie foo
The search results for foo should return.
You can change the results type of the results by passing in the r option.
node bin/birdie -r recent foo
Or the long option
node bin/birdie -resulttype recent foo
The r option takes in either mixed, recent or popular.