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.
- 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)
You will need to:
- Execute the 'tables.sql' file in your MySQL database; this will create the tables you need for storing of tweet data
- The assumption is that you have tweet IDs to collect stored in the newly created 'altmetric_twitter_keys' table.
- Ensure you have all the files installed on a web server where you can execute PHP
- 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. Thenohup
command will allow you to run the script in the background. - Once the retrieval of your tweet objects is finished, you can run the parse file.
- 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. Thenohup
command will allow you to run the script in the background. - If all goes well, you will have all your tweets parsed and entered into the relational MySQL db.
- twitteroauth - Twitter Oauth
- Timothy D Bowman - Initial work - tdbowman.com
This project is licensed under the MIT License - see the LICENSE.md file for details