Downloading Tweets by a List of Users

This post is a brief, temporary attempt at pointing people in the right direction for a common task: downloading tweets sent by a number of different Twitter users. It is directed at those who are new to Python and/or downloading data from the Twitter API.

OK, so I am assuming you have made it through (or intend to) the following tutorials, which should help you get set up and working with Python:

Another detailed tutorial I have created, Usint Python to Grab Twitter User Data, is intended to serve as an introduction to how to access the Twitter API and then read the JSON data that is returned. This gets you the account-level data for a Twitter user (such as when the account was created), but not the actual tweets. That is a more difficult process, but not a huge leap once you’ve made it through all of the above steps.

I have yet to upload a tutorial showing how to use my code to download tweets by a list of Twitter users, but fortunately my PhD student Wayne Xu has. This tutorial helps fill in the blanks. It will help walk you through the steps of getting a Twitter developer account (so you can access the API), of which database to use (SQLite), and then how to access and store data from the Twitter user_timeline API, which allows you to download up to the last 3,200 tweets sent by each Twitter user.

I hope this helps. Happy coding!

EndNote Tutorial, Part I: Building a Library

This tutorial is mostly for my co-authors (smile), but I am hoping it proves helpful for my students and others as well.

After you have downloaded and installed EndNote, your next step is to open a new library in EndNote and populate that library with references. There are a number of good approaches for building a library. One is to simply ask someone who has already built one and works in your research area to share theirs with you. Another is to use CiteULike or Mendeley or some other reference manager. Both good approaches. But let’s assume here you’re starting from scratch.

Let’s say you want to cite the following article:

Xu, W. W., Sang, Y., Blasiola, S., & Park, H. W. (2014). Predicting opinion leaders in Twitter activism networks: The case of the Wisconsin recall election. American Behavioral Scientist, 58, 1278-1293.

Here’s the algorithm. First, copy and paste the title into Google Scholar:

Screen Shot 2014-10-18 at 7.23.31 PM

Hit Enter. Your article usually shows up as the first (or only) entry. You can usually get away with not entering the full title:

Screen Shot 2014-10-18 at 7.23.50 PM

Click the “cite” button. A pop-up will appear showing you the citation in various styles. Click the EndNote link and an EndNote file (*.ris extension) will download to your computer.

Screen Shot 2014-10-18 at 7.24.05 PM

Now, go to EndNote and go to File –> Import:

Screen Shot 2014-10-18 at 7.24.22 PM

Navigate to the *.ris file you downloaded, and now you have it!

Screen Shot 2014-10-18 at 7.25.01 PM

Note that Google Scholar has different settings you can modify according to your preferences. The example I showed above was with “Don’t show any citation import links” selected. However, if you’re only going to be using EndNote, you can select instead (as shown below) “Show links to import citations into EndNote.”

Screen Shot 2014-10-18 at 7.26.04 PM

If you’ve set up your preferences this way, Google Scholar will automatically show you “Import into EndNote” button, saving you a step.

Screen Shot 2014-10-18 at 7.25.54 PM

If you’re one of my co-authors, I hope this helps nudge you into the land of milk and honey that is the EndNote universe. For all others, if you’ve found this helpful, please share and pay it forward.

Let’s Ban the One-Way Informational Meeting


As I was sitting in a meeting today — bored out of my tree — my mind drifted to research (hey, it’s what I do). It occurred to me that social media researchers have a decent message framework that can also be used for categorizing different types of meetings according to the intended audience role. And that the reason I hate am not particularly fond of meetings is that most employ the least effective audience role.

[bibshow file=I-C-A.bib, format=apa template=av-bibtex-modified]

Let me explain. Social media researchers, myself included, have begun to classify social media messages based on whether the message is aimed at one-way information, two-way dialogue and relationship-building, or mobilization and action (for a review, see Lovejoy & Saxton, 2012).[bibcite key=Lovejoy2012] This same framework can be applied to meetings. In one-way informational meeetings, the audience members is intended to be a passive recipient of information. In two-way communication meetings, there is a real exchange of ideas and the audience member serves as conversant and generator of ideas. And lastly, there are action-oriented meetings, or meetings where the aim is to get something done, with the audience member put in the role of “doer.”

Most meetings are boring ineffective because they are devoted to the one-way delivery of information from a presenter to a passive audience. Often the inefficacy of these meetings is compounded by ineffective use of Power Point, but that’s another matter. Here’s the thing: Meetings where one person simply gives us a “report” are boring. They are ineffectual. Ineffective. Lacking in efficacy. You should not do them. They are a waste of time. They should be banished from the face of the planet. Those violating this rule should be (figuratively) keel-hauled.

The point is, information can be conveyed much more efficiently in any number of different ways. Meetings should be reserved for building relationships, for sharing ideas, for working through important organizational issues. In short, meetings should be used as a tool for helping move an organization toward meeting its strategic aims. They should, in other words, conform to a mobilizational action model or a two-way dialogic model. So before you schedule a meeting, ask yourself this: “Are we going to discuss or do anything that will help us meet our mission?” If the answer is “no,” then cancel the meeting or reconsider your agenda. Let’s ban the one-way informational meeting.


How Many Tags is Too Much?

Including a hashtag in a social media message can increase its reach. The question is, what is the ideal number of tags to include?

To answer this question, I examine 60,919 original tweets sent in 2014 by 99 for-profit and nonprofit member organizations of a large US health advocacy coalition.

First, the following table shows the distribution of the number of hashtags included in the organizations’ tweets. As shown in the table, almost a third (n = 19,747) of tweets do not have a hashtag, almost 39% (n = 23,493) have one hashtag, 19% include two hashtags (n = 11,836), 7% include three (n = 4,381), and 2% (n = 1,161) include 4. Few tweets contain more than 4 tags, though one tweet included a total of 10 different hashtags.

Frequency of Hashtags in 60,919 Original Tweets

# of HashtagsFrequency

Now let’s look at the effectiveness of messages with different numbers of hashtags. A good proxy for message effectiveness is retweetability, or how frequently audience members share the message with their followers. The following graph shows the average number of retweets received by tweets with different numbers of hashtags included.


What we see is that more hashtags are generally better, but there are diminishing returns. Excluding the 25 tweets with more than 6 hashtags, the effectiveness of hashtag use peaks at 2 hashtags, with more than 3 hashtags being only as effective or less effective than no hashtags.

The evidence isn’t conclusive — especially given the anomalous findings for the few tweets with 7-10 tags — but there is strong support here that, if you want your message to reach the biggest possible audience, limit your tweets to 1-2 hashtags.