Background
For the past four years, we’ve done a Game of Life lab as part of the Decisions and Loops unit in AP Computer Science. I love that lab for many reasons. However, after four years and not using GridWorld anywhere else in the curriculum, I’ve decided it was time for a change. I’ve wanted to incorporate data analytics and visualization into a lab. After some research and ideas from a couple of labs developed by others, I’m excited to try a new lab this year: Twitter Mapping.
Introduction
From what I provide students:
Your application will allow the user to search Twitter for a particular word or phrase in tweets located in each of the 50 US states and then display on a map of the US the degree of positive or negative sentiment associated with that search term in each state. For example, if the search term is coding, the following map may be displayed.
- This lab has several goals beyond the immediate concepts of decisions, loops, and unit tests in this unit:
-
Exposure to data analytics. In this lab you will search a large data set (tweets on Twitter) and analyze that data to derive a new understanding (the sentiment of tweets containing a given keyword in each of the 50 US states).
-
Experience using an API (Application Programming Interface) within the context of an unfamiliar software application. In this lab, you will use the Twitter4J API to access Twitter and write code within the partially implemented Twitter Mapping Lab application.
-
Exposure to data visualization. In this lab you will visually represent the average sentiment in a map of the 50 US states.
Details
Feel free to read the entire lab document and check out the GitHub repository with the starter code. If you would like a sample solution, please contact me.
Credits
-
This lab and parts of this document arebased on Ria Galanos’ Twitter Project.
-
This lab is based on Stanford’s Nifty Lab’s Twitter Trends project by Aditi Muralidharan, John DeNero, and Hamilton Nguyen. The sentiment file included is from the Twitter Trends project.
-
The visualization is done using the DataMaps Javascript framework. Specifically, the HTML file is based on the Choropleth with auto-calculated color example.
-
The data for the geographic center and area of each state was obtained from Wikipedia.
This is a great extension of Ria’s original project, which I’ve used in the past. The link to the GitHub repo isn’t valid anymore. Any chance you can share the starter code again?
Sorry about that. I moved around a bunch of repositories. I just updated the post. The repository is now available here: https://github.com/NNHSComputerScience/twitterMappingLab
Thanks for the link, Geoff. Any chance I can ask you some specific questions about the assignment offline?
Of course! Feel free to email at my Twitter handle @ gmail.com