Daily Hacker

Sunday, 6 July 2014

How to Save Tweets for any Twitter Hashtag

You can create your own Twitter Archiving tool using Google Sheets in 5 minutes. It will automatically save all tweets for any Twitter hashtag or search term in a spreadsheet.
Wouldn’t it be nice if Twitter had an Export button? You search for something, maybe a trending #hashtag or your brand name, and all the matching tweets would get saved in a spreadsheet. And the archive would update itself as new matching tweets are posted on Twitter in the future.

Well, Twitter is unlikely to provide you an option to save search results directly but here’s a do-it-yourself solution that takes 5-minutes to implement (watch video) and it will capture all matching tweets for your search term(s) and hashtags in a Google Spreadsheet automatically.

The idea is simple. This Google Spreadsheet talks to Twitter through a Google Script and imports all the search results into the sheet. It will make this connection to Twitter every few minutes and fetches any tweets, if available.

Save Tweets Forever in a Spreadsheet

The Twitter Archiver is available in two editions – free and premium. The premium edition allows you monitor multiple search terms and hashtags in the same Google sheet. It is significantly faster at fetching tweets and can even pull old tweets that have been posted in the previous 6-8 days.

FeaturesFreePremiumPremium+
Automatically archives new (incoming) tweetsYesYesYes
Support for Twitter search operatorsYesYesYes
Capture old tweets (last 6-9 days)NoYesYes
Archiving speedNormalFastFast
Monitor multiple search terms and hashtagsNoYesYes
Installation manual (PDF) includedNoYesYes
Support optionsSupport ForumsEmail SupportOne-to-one support over Skype or Google Hangouts
Choose your editionForever FreeGet PremiumGet Premium+
You may make payments through PayPal or your credit and debit cards. You can request a refund within 24 hours of purchase.

How to Use Twitter Archiver

Click here to copy the Twitter Archiver sheet into your Google Drive. Set the name of the sheet as a hashtag or a search phrase. For instance, you could set the sheet name as #WorldCup2014 to save all the FIFA related tweets.
Open apps.twitter.com and create a new app. In the Callback URL field, put https://spreadsheets.google.com/macros and save your changes. Select the API Keys tab and make a note of the Twitter Consumer Key and Secret.
Switch to your Google sheet and select Tools -> Script Editor. Don’t worry, you don’t have to write a single line of code here, just copy-paste the Twitter secret and key inside the editor. Now select the Run menu, choose Initialize and grant the necessary permissions.
That’s it. The tweets will now appear inside your Google Sheet. These are the first set of 100 tweets and new tweets will be automatically pulled and added into your sheet every few minutes.

In addition to tweets, the Twitter Archiver app also imports other data like the tweet’s retweet & favorite count and the tweeter’s friend & followers count. This data will help you filter out the spam or figure out the most influential tweets from the imported data.

The Twitter Archiver sheet will run in the background and monitor Twitter for new tweets.

Since the tweets are saved in a standard spreadsheet, you can easily export the search results in various formats including PDF, CSV or even publish your data set as an HTML web page (choose File -> Publish to Web inside Google Sheets). Advanced users may try this technique to create JSON or RSS Feeds from Twitter.

No comments:

Post a Comment