I archive hashtags on Twitter pretty frequently. (See #kzoo2014, #babel15, #hastac2015, here, and here, for example) Whether it’s to provide a record of a conference or to see how a particular community uses the rhetoric of a particular hashtag over time, this functionality has become vital for me. And it’s not that way because I am a programming wizard. It’s because of the amazing and generous work of Martin Hawksey.
Thanks to Hawksey’s TAGS tool, setting up a Twitter archive and a network visualization is amazingly easy. The first time, you will need to set up a Twitter application, but after setting it up once, you will be able to run any number of TAGS archives off of it. This tutorial will guide you through the process of setting it up for the very first time.
What you need:
- Twitter account
- Google account (so that you can access Sheets)
Setting up TAGS for the first time:
- It helps to be logged in already to both Google and Twitter.
- Go to the TAGS website and select “Get TAGS (New Sheets)”
- This will open up a Google Sheet that you will only be able to View. Create a copy, and an identical one will be saved to your Google Drive
- Check to see if there is a menu item in the top menu list called “TAGS.” If it isn’t there, click on the “Enable custom menu” button toward the middle of the screen.
- Once you have the TAGS button in the menu bar, select it and “Setup Twitter Access”
- It will ask for authorization (which is you giving the script/app permission to run using your Google account).
- Now that you have given TAGS permission to use Google, you need to give it permission via Twitter. This process involves setting up an API.
- Open the link to the https://dev.twitter.com/apps/new
- Fill in the fields – you can name things anything you want and put in a dummy url if you like. BUT make sure to enter the callback URL as https://script.google.com/macros. Then agree to the terms, and you’ve created a Twitter app.
- Go to the “Keys and Access Tokens” area from the top menu
- Copy and paste the API key and API secret into the text boxes back in your Google Sheet, and select Authorize. Then click “next”.
- You will be taken to a new tab that says “This app needs authorization to run.” Click “continue”, and you will be prompted to provide access to another script (Twtr Service) via your Google account. Click “allow.”
- Then you will need to connect to your Twitter account. Click “sign in with Twitter.”
- Click “Authorize app” to give permission for the app you created to use your Twitter account to access Twitter feeds and search capabilities.
- Back in your Google Sheet, exit out of any open boxes. In the middle of the screen, enter whatever search term or phrase you want to archive. This could be a hashtag, a series of hashtags, a handle, or a combination of those. This box acts as a search box within Twitter. [Unfortunately, you cannot enter a Twitter List you created to be archived.]
- Under the TAGS button on the menu bar, I like to go ahead and click “Add Summary Sheet” and “Add Dashboard Sheet” right away.
Two new sheets will be added in addition to the “Readme/settings” and “Archive” sheets that were already there.
- Under the TAGS button again, click “Run Now!” and “Update archive every hour.”
Now you have a running Twitter archive! You will notice that the Archives sheet will start to fill with results – sometimes it takes a little while for past tweets to populate the sheet. Remember that TAGS can only provide tweets from around about the past week. Download the archive as an Excel or csv file as a backup and/or to clean or play with the data.
- In the Dashboard sheet, you’ll see some trends information about the tweets you’ve gathered.
- In the Summary sheet, you can see top tweeters, average number of Retweets, etc. There are also two links to additional ways of viewing the data:TAGS Archive (a searchable archive of tweets) and TAGSExplorer (a network visualization).
- Before opening either of these options, you’ll need to publish your sheet to the web. First, go to “Share” in the top right corner of the screen. Click “get shareable link” and adjust settings so that “anyone with the link can view”. Then click “Done”.
- In the main menu of the page under “File” select “Publish to the web” and click “Publish.”
- Now back in the Summary sheet, if you click on TAGS Archive, you’ll be taken to a new tab with a more user friendly search functionality than the “Archives” tab of your Sheet.
- In the Summary sheet, click on TAGSExplorer, and you’ll be taken to a new tab where a dynamic network visualization will show the participants of the archive. You can explore the top tweeters, search the archive, and click on individual nodes to learn more about what has been said.
The first time setting things up requires many steps, but as you can see, they are mostly a matter of getting permissions set up. To set up a new TAGS archive after having done it once, just make a copy of the TAGS template, enter your search term, and click Run Now!