Code Monkey home page Code Monkey logo

nodejs-twitter-crawler's Introduction

NodeJS Twitter Crawler

last-release npm-version npm-license Build Status codecov.io npm-downloads

Crawl twitter users and user tweets but using multiple credentials. Credentials used in a round-robin mode.

Using the component

NodeJS Twitter Crawler is implemented using promises. You will need to use promises pattern to add callbacks to crawler method invocations.

var crawler = new TwitterCrawler(credentials);

crawler.getUser(/* CrawlerParameters */)
  .then( /* Success Callback */ )
  .catch( /* Error Callback */ )

crawler.getTweets(/* CrawlerParameters */, { limit: /* Desired limit, you can omit this */ })
  .then( /* Success Callback */ )
  .catch( /* Error Callback */ )

API Methods

The available methods are the following ones:

  • getUser :: CrawlerParameters -> Promise - Obtain the user status from Twitter by calling users/show method from Twitter API. The then callback will receive the user information.
  • getTweets :: (CrawlerParameters[, CrawlerOptions]) -> Promise - Obtain User Tweets by calling statuses/user_timeline method from Twitter API. The then callback will receive a list of tweets.

Definitions

  • CrawlerParameters can be a TwitterID or a TwitterParameters object.
  • TwitterID is the numeric Twitter ID or the Twitter Handle.
  • TwitterParameters is an object with parameters to be passed to Twitter API. E.g. this documentation shows that GET statuses/user_timeline can receive parameters such as user_id or exclude_replies.
  • Promise is a promise as defined by BlueBird package.
  • CrawlerOptions is an object containing options for the crawling with attributes:
    • limit: sets the max count of tweets to collect.
    • min_tweets: forces a minimum tweet count. If set and not satisfied, it will result in rejection.

nodejs-twitter-crawler's People

Contributors

germanattanasio avatar arypbatista avatar beeman avatar herchu avatar neil-boyette-ibm avatar

Stargazers

 avatar Blue avatar jcrashkit avatar Denham Rogers avatar 杨亚梦 avatar hai avatar M4ster avatar Brian Soumakian avatar hms avatar Austin T avatar

Watchers

James Cloos avatar  avatar

nodejs-twitter-crawler's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.