Optimizing your twitter feed for course websites

George Hoberg
September 16, 2011 – Update September 26

Note: after writing the initial version of this post, twitter changed it search parameters so that the code originally outlined did not do what it was  designed to do. We’ve revised the code so that it now works with the new search parameters.

I’ve been working on incorporating social media into my courses for the past several years. Here’s a description of what I’m doing this term in my sustainable forest policy class at UBC. I have a facebook page I try get students to “like” so they can share resources and ideas. I’ve been an active twitter user since 2009, and include a twitter feed on my course website. One of the issues I’ve confronted is limiting that feed to only those tweets most relevant to the course. I tweet on a lot on energy and climate issues, and politics, that are not directly relevant to the forest policy.

What I decided to do is have the feed show only tweets with the course-specific hashtag in it (in this case, #FRST415). That way I can control which of my tweets end up in the course feed, and students can get things in the feed as well by using that hashtag.

When we tried this, however, another dilemma came up. When my items with the course hashtag were retweeted, those would show up as well, creating a lot of redundancy. Our wonderful IT expert in Forestry, Renita Drakes, was able to redesign the search parameters in the twitter widget to exclude retweets of my items (although not those that others will post with the hashtag).

Here is how she has modified the code to create the feed I have on my website, shown here. We’re posting this in the event others might want to tailor this to their websites to avoid the same problems. Or if you have suggestions for improvement, please comment.


<script src=”http://widgets.twimg.com/j/2/widget.js“></script>


new TWTR.Widget({

version: 2,

type: ‘search’,

search: ‘#frst415  -\”RT @ghoberg:\”‘,

interval: 10,

title: ‘Recent Tweets’,

subject: ‘Sustainable Forest Policy’,

width: 255,

height: 300,

theme: {

shell: {

background: ‘#74a0a3′,

color: ‘#ffffff’


tweets: {

background: ‘#ffffff’,

color: ‘#444444′,

links: ‘#74a0a3′



features: {

scrollbar: true,

loop: true,

live: true,

hashtags: true,

timestamp: true,

avatars: true,

toptweets: true,

behavior: ‘all’





This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>