GithubHelp home page GithubHelp logo

aythae / twitter_search Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 20 KB

Python program to recover tweets and export it to .csv

License: GNU General Public License v3.0

Python 100.00%
python3 gephi tweepy twitter twitter-api social-network social-network-analysis csv

twitter_search's Introduction

twitter_search

Python program to recover tweets and export it to .csv. It uses Tweepy to handle Twitter API. The script create 3 files:

  • queryX_(dateSince_dateUntil)_Tweets.csv: Contains the Tweet text and id, the creation date, the user that wrote it and some info about him/her.
  • queryX_(dateSince_dateUntil)_Users.csv: Contains the same user data than the previous file but without duplicated users. It is prepared to be imported into Gephi as a nodes table spreadsheet.
  • queryX_(dateSince_dateUntil)_Edges.csv: Contains the relationships between tweets (retweets and mentions). It is prepared to be imported into Gephi as a edges table spreadsheet.

To use this program you need to register a Twitter application to get the required credentials and insert it on the file credentials.py.

Tutorial

A complete tutorial for this could be found here.

Use

You need to install Python 3 and virtualenv before use this program. When this is done you could install the rest of the dependencies executing the next commands (the commands could be different in your OS):

virtualenv -p$(which python3) venv
source venv/bin/activate
pip install -r requirements.txt

And run the script with:

python twitter_search.py

twitter_search's People

Contributors

aythae avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

aniketyevankar

twitter_search's Issues

Problem with .Json format

The Json format resulted from the script cannot be use, i think there's a problem with the spacing on the file...

any idea?

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.