A short set ofexamples of accessing Twitter with a node app, searching for documents, and inserting the found documents into MongoDB. This is an example from Mongo University from the class M101JS: MongoDB for Node.js Developers.
To get set up download the example files and run "npm install" in the directory where you downloaded the files.
Twitter Developer Documentation is here: https://dev.twitter.com/overview/documentation
Documentation on the streaming API is here: https://dev.twitter.com/streaming/overview
Documentation on the REST API is here: https://dev.twitter.com/rest/public
To use any of the Twitter APIs you will need access tokens. The simplest means of acquiring access tokens is described here: https://dev.twitter.com/oauth/overview/application-owner-access-tokens
The Twitter API client library for Node.js that I used in the lessons is found here: https://www.npmjs.com/package/twitter
Note that you can place your access tokens in a separate file (.env) and use the following package to load them. https://www.npmjs.com/package/dotenv
The package.json file for this lesson contains the dependencies for the twitter and dotenv packages. See the applications in the handouts for examples of how to use. The documentation for the twitter and nodenv packages provides details on setting up your tokens as environment variables, loading them, and using them to access the twitter API.