Tools

Tweet downloader

Downloading

The tweet downloader is available here: tweet_basic-retriever.zip

Installation and use

Note: you need a twitter account
  1. Go to the URL: https://apps.twitter.com/
    • select: create twitter application
    • fill in form then agree then ok
  2. if you are asked for a portable phone number:
    in another web browser window, add portable phone number to your twitter account: https://twitter.com/settings/devices
  3. Once you application is created, you should get the following information with in particular the two following keys (personal information are in brackets and may be not displayed):
    
    App.TwitterConsumerKey=[...]
    App.TwitterSecretKey=[...]
    
    APPLICATION INFORMATION:
    -----------------------
    Application Management
    [deft2015]
    To bring you Twitter, we and our partners use cookies on our and other
    websites. Cookies help personalize Twitter content, tailor Twitter
    Ads, measure their performance, and provide you with a better, faster,
    safer Twitter experience. By using our services, you agree to our
    Cookie Use.
    Your application has been created. Please take a moment to review and
    adjust your application's settings.
    [Firstname Lastname]
    Test OAuth
    Primary tabs
    
    Details(active tab)
    Settings
    Keys and Access Tokens
    Permissions
    
    [challenge organiser]
    
    [https://deft.limsi.fr/2015]
    Organization
    Information about the organization or company associated with your
    application. This information is optional.
    Organization None
    Organization website None
    Application Settings
    ...
    	      
    	    
  4. MENU: Key and Access token (from my Twitter Application subsite) You should get the following information with the two following supplementary keys (personal information are in brackets and may be not displayed):
    	      
    App.TwitterAccessToken=[...]
    App.TwitterAccessTokenSecret=[...]
    
    
    Application Settings
    Keep the "Consumer Secret" a secret. This key should never be
    human-readable in your application.
    Consumer Key (API Key) [...]
    Consumer Secret (API Secret) [...]
    Access Level Read-only (modify app permissions)
    Owner [deft2015]
    Owner ID [...]
    Application Actions
    Regenerate Consumer Key and SecretChange App Permissions
    Your Access Token
    This access token can be used to make API requests on your own
    account's behalf. Do not share your access token secret with anyone.
    Access Token [...]
    Access Token Secret [...]
    Access Level Read-only
    Owner [deft2015]
    Owner ID [...]
    Token Actions
    Regenerate My Access Token and Token SecretRevoke Token Access
    	      
    	    
  5. Put the 4 codes into the file .../tweet_basic-retriever/App.properties (personal information in brackets are not displayed)
    	      
    App.TwitterConsumerKey=[...]
    App.TwitterSecretKey=[...]
    App.TwitterAccessToken=[...]
    App.TwitterAccessTokenSecret=[...]
    	      
    	    
  6. in the file .../tweet_basic-retriever/App.properties provide the following 3 parameters:
    
    # by default, retrieve only tweet as txt file, uncomment to have both
    txt and json
    App.retrievemode=mixte
    
    # Filepath of file containing IDs to retrieved. 1 ID per line
    App.InputFile=/home/pap/uComp_CHISTERA2012/TOOLS/tweeter_downloader_amel_fraisse/DATA/test/tweet_id_list_10_items.txt
    
    # Folder on wich the retrieved tweets will be written. Must be ended by /
    App.OutputPath=/home/pap/uComp_CHISTERA2012/TOOLS/tweeter_downloader_amel_fraisse/DATA/test/
    	      
    	    
  7. Now the tweet downloader can be run:
    	      
    cd .../tweet_basic-retriever/
    java -jar -Dlog4j.configuration=file:log4j.properties tweet_basic-retriever.jar
    	      
    	    
    It works! The printed tweet ids are well downloaded:
    
    15:57:54,047  INFO TweetsRetriever:126 - Tweet 505339685557006336
    successfully retrieved
    15:57:54,050  INFO TweetsRetriever:126 - Tweet 504663001132437505
    successfully retrieved
    15:57:54,050  INFO TweetsRetriever:126 - Tweet 506672487196004352
    successfully retrieved
    15:57:54,051  INFO TweetsRetriever:126 - Tweet 506829902746636288
    successfully retrieved
    15:57:54,052  INFO TweetsRetriever:126 - Tweet 506430083008323584
    successfully retrieved
    15:57:54,052  INFO TweetsRetriever:126 - Tweet 506116782600757249
    successfully retrieved
    15:57:54,052  INFO TweetsRetriever:126 - Tweet 507388449792335874
    successfully retrieved
    15:57:54,052  INFO TweetsRetriever:126 - Tweet 507206491330609152
    successfully retrieved