Giter VIP home page Giter VIP logo

retrievetweets's Introduction

retrieveTweets

The first script (retrieve_100Tweets_usingTweetID.php) allows someone to retrieve 100 tweets per call to Twitter API using a known tweet ID. It was developed in order to retreive the tweet object from the Twitter API using tweet IDs collected by Altmetric.com. The second script (parseJSON_tweets_from_TwitterAPI.php) parses the JSON files and inserts the tweet object data into a relational MySQL database.

Getting Started

To use the script, you will need to have both PHP 7.x and MySQL installed and running on a web server. You will also need to create a MySQL database with tables using the .sql files in the MySQL folder.

Prerequisites

  • You need to have PHP v7.x installed.
  • You need to have the latest version of MySQL installed
  • You need Twitter API keys to access the Twitter API
  • You will need space to store the JSON files on the server (space size depends on number of tweets you are retrieving)

Installing

You will need to:

  1. Execute the 'tables.sql' file in your MySQL database; this will create the tables you need for storing of tweet data
    1. The assumption is that you have tweet IDs to collect stored in the newly created 'altmetric_twitter_keys' table.
  2. Ensure you have all the files installed on a web server where you can execute PHP
  3. You can run nohup php retrieve_100Tweets_usingTweetID.php > retrieveFile.log & from a terminal on the server when you are in the directory where this file is located. The nohup command will allow you to run the script in the background.
  4. Once the retrieval of your tweet objects is finished, you can run the parse file.
  5. You can run nohup php parseJSON_tweets_from_TwitterAPI.php > parseFile.log & from a terminal on the server when you are in the directory where this file is located. The nohup command will allow you to run the script in the background.
  6. If all goes well, you will have all your tweets parsed and entered into the relational MySQL db.

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

retrievetweets's People

Contributors

tdbowman avatar

Stargazers

Adem Öztürk avatar

Watchers

 avatar James Cloos avatar Adem Öztürk avatar

Forkers

gurugeek

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.