GithubHelp home page GithubHelp logo

davidenunes / tweet-download Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 97 KB

Tools to download tweets and create a keyword-based twitter dataset

License: GNU General Public License v3.0

Scala 50.38% CSS 8.82% XSLT 40.80%

tweet-download's Introduction

Twitter Tools

The original idea was to create a simple tool to download tweet data. This data is to be used to explore Natural Language Processing (NLP) tools and information retrieval techniques.

For now, this library is only capable of: retrieve tweets based on keyword search and retrieve tweets based on a file with one search term per line.

The library is written in scala and built using sbt. It wraps around Twitter4J and provides a way to download tweets beyond the API limits: meaning that each time the search API resource limits are reached, we wait for the next time window.

Keep in mind that twitter ToS prevent you from supplying any tweet dataset by the means of automatic download of a file. If you plan on distributing any dataset of tweets I would recommend distributing the data with reference to the Tweet IDs only - since tweet content belongs to twitter.

Command Line Interface

I also packed everything in a self-contained Jar file that can be used to run the tool from the command line.

The self-contained Jar was compiled with Java 7.

Download Tweets with a Keyword

java -jar twitter-tools.jar get-keyword -k hello -n 10000 -c twitter-tools.conf

This will produce a file named hello_tweets.csv in the current directory. You also need to supply a configuration file (in this example: twitter-tools.conf). This contains the API keys and secrets along with other configurations. An example configuration file you can modify is supplied in the resources folder (see here).

Download Tweets with Keyword File

You can also download tweets by supplying a file with a set of terms (one per line) and evoking the following command.

java -jar twitter-tools.jar get-keywords -f input_keywords.txt -n 10000 -c twitter-tools.conf

If the input file contains n lines, this will create n files as output. Each file name is prefixed with the keyword used and contains -n tweets.

Licence

Twitter Tools

This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this library . If not, see GPL 3.0.

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.