Git Product home page Git Product logo

twitter-scraper's Introduction

##Requirements

This requires the Twitter gem and a registered Twitter application. Follow instructions for the Twitter gem in an empty directory first.

##Config

In order to use this repo, you must first generate a twitter application. Make sure to set the permissions to "read and write" (or optionally "read, write, and send direct messages").

Enter your twitter app credentials in the user_scraper.rb as follows:

    client = Twitter::REST::Client.new do |config|
        config.consumer_key        = "YOUR_CONSUMER_KEY"
        config.consumer_secret     = "YOUR_CONSUMER_SECRET"
        config.access_token        = "YOUR_ACCESS_TOKEN"
        config.access_token_secret = "YOUR_ACCESS_SECRET"
    end

##Usage

There are three modules - the tweet scraper, the user scraper, and the follower.

Use the tweet scraper to scrape tweets of other users. You can tweet those as your own, or use them however you'd like.

The user scraper searches for keywords and scrapes anyone who has tweeted using that keyword.

The follower takes the scraped users and follows them. You can swap out that file for any file of usernames.

There are no limits on numbers other than those put in place by Twitter rate limiting. Those should be plenty for most non-spammy purposes, so there's no multi-threading or proxy support.

There are three fields that are recommended for editing.

  • The first, filename = "tweeps.txt", determines where the outputted usernames will be saved.

  • The second, keyword 1, keyword 2 and keyword 3 are the keywords you'll be scraping for. (Leaving one blank will skip it).

  • The third, numberOfTweeps = 5000 determines how many twitter usernames will be scraped per keyword.

To run the program, go back to your command line in the root directory of the repository, and ener ruby user_scraper.rb

twitter-scraper's People

Contributors

austenallred avatar

Watchers

 avatar  avatar

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.