Archive for the ‘Elections’ Category
How we used a Google spreadsheet to power our election app
Last Tuesday was election night in the Cedar Valley. While we didn’t have a huge number of contested races on the ballot, we did have a mayor’s race in Waterloo and Waverly, Iowa, as well as city council races in several area towns.
As NPR’s Jeremy Bowers proudly proclaimed, election nights are exciting times for news nerds. This election, we decided to do a little bit of experimenting.
Before the election, we posted biographical information for all the candidates running in a contested race in Waterloo, Cedar Falls and Waverly. We also promoted other races in smaller towns. This gave our readers a good overview of the races on the ballot and information on the candidates. And best of all, it was all in one place.
Three reporters were responsible for getting the biographical information for each candidate and entering it online. We used a Google spreadsheet to store the information. This allowed the reporters to enter the information online themselves. I could then go into the spreadsheet, edit the text and make sure it was formatted correctly. We then used Tabletop.js to import the data into our app and Handlebars.js to template it.
The basic setup for the app is available on my Github page. This is a very similar setup mentioned in my last blog post.
Before the app went live, I exported all the data in the Google spreadsheet into JSON format using a method mentioned here. I did this for two reasons: 1) It spend up the load time of the app because browsers didn’t have to connect to the spreadsheet, download the data, format the data into JSON (which is what Tabletop.js does with the data in this app) and then display it online using templates rendered in Handlebars.js. Instead, it’s already downloaded, formatted into JSON and ready to be templated. And: 2) Tabletop.js has a bug that may cause some readers not to see any of the data at all. I wanted to avoid this problem.
The night of the election, we wanted to update the election results live. And we wanted to use the same app to display the results. Fortunately, the process was easy to do: I added new columns in our spreadsheet for vote totals and precincts reported. The new data was then pulled into our app and displayed with simple bar charts.
To display the results live, we had to ditch the exported JSON data and use the Google spreadsheet to power the app. This allowed us to update the spreadsheet and have the results display live on our website. We had one reporter at the county courthouse who punched in numbers for our Waterloo and Cedar Falls races. We had another reporter in Waverly who punched in results for races in that town. And we had another reporter in the newsroom who was monitoring the races in rural towns and giving me updated election results to enter into the spreadsheet.
The workflow worked great. While most news outlets were waiting for the county websites to update with election results, we were able to display the results right away. Unfortunately, the Black Hawk County website never wound up working on election, making our app the only place readers could go to get election results.
Our effort paid off: The app received about 11,500 pageviews, with about 10,000 of those pageviews coming the night of election (about 7,000 pageviews) and the following day. The app was more popular than any single story on our website for the month of October and November.
Reporters at the party headquarters said many of the candidates first tuned into the local television station to get election results but quickly went to our webpage when they realized we were the only ones with updated results. In fact, Waterloo’s mayor found out he won his race by looking at our website. Here’s a photo of him checking out our website on election night.
Which leads me to my last point: You’ll notice how our mayor is checking out the results on a smartphone. Our app (like all of our apps) was responsively designed, which means it looks great on mobile phones. It’s critical that news producers make sure their apps work on mobile. It’s pretty much mandatory. Because as our mayor shows, people love checking the news on their phones.
Going mobile with our news apps
It’s been about two months since we launched our crime map for the city of Waterloo and so far, the response has been overwhelmingly positive.
I’ve been proud of our fans on Facebook, in particular, who are using the map to make informed opinions on crime in the area. One of our fans actually counted every dot on the map to counter another fan’s claim that crime only happens on the east side of town. He found crime was almost equally spread across the town.
In hopes that this data will be digested by an even larger audience, I launched the mobile/tablet equivalent of the map last week. The new app is fully responsive thanks to Twitter’s Bootstrap framework. If you haven’t check out Bootstrap, you really should. It makes designing websites for all platforms — desktops, tablets, mobile phones — about as easy as its going to get.
I also went in and modified a lot of the CSS, changing things like the width of objects on the page from pixels to percentages. This ensures that the app looks great no matter how wide the screen you’re viewing it from is.
Serving up the tablet version of the map wasn’t particularly difficult. It’s basically the same map on our site without the header and footer, which seems to load slower on iPads. It’s also designed to be flexible regardless of how wide your tablet screen is.
The mobile version was more difficult. At this time, the mobile app does not have a map of the crimes. Instead, it’s just the color charts comparing different crimes and a table of all the crime data. I stripped out the map mostly because it’s difficult to click individual points on the map on small mobile screens. But screens continue to get bigger and nicer so hopefully this won’t be a problem in the future.
One pro tip: I set the padding-right CSS property on the table of crimes to 10 percent. This gives a nice cushion to the right of the table, making it easier for people to scroll past it on smartphones with touch screens.
For this project, I went about making the mobile version the completely wrong way: I opted to create just the desktop version at first and then go back and make one for tablets and phones.
Ideally I would have done both at the same time, which is easy to do with Bootstrap. And that’s exactly what I did for another project we launched this weekend on campaign finance reports. The project exams the finance reports for candidates running in four local races. The reports are made available by the Iowa Ethics and Campaign Disclosure Board, which fortunately allows users to export the data into CSV files.
We broke down the data and created bar charts using Bootstrap to compare the figures. The framework has several bar options to easily create the bar charts, which are worth checking out. The best part is they are designed to look good on all platforms.
We also have databases of all the contributions that are searchable. This allows readers to see exactly where the money is coming from.
For this project, I created the mobile and tablet equivalents of app as I was creating the desktop version. When viewing it on a desktop computer, the app is embedded on our website so it has the election header, footer and colors. The same app was created with responsive design in mind. So if you open it on a mobile phone, the app will look just as good on a tablet or smartphone as it does on a desktop computer.
Many studies show that more and more people are getting their news on smartphones. It is imperative that we keep those readers in mind when designed full-scale apps for our websites.
Hopefully we can continue this trend at the Courier and make sure our projects are reaching our full audience.
What a night
Wow. Tonight’s primaries were unprecedented, unpredictable and pretty much everything in between. As it stands, Bill Brady is leading in the GOP governor primary, while Pat Quinn leads for the Democrats. A total of 99 percent of the precincts are in. But Republican Kirk Dillard and Democrat Dan Hynes are not far behind and both vow to fight, fight, fight. This could be settled in court and take months. The race for Democratic comptroller is also coming down to the wire. State Rep. David Miller is in the lead at the moment, but Raja Krishnamoorthi also vows to keep the battle going. The races for lieutenant governor are also–you guessed it–strikingly close. While it’s possible these races could be decided in the next few hours (it’s all ready 1:15 a.m. as it is), I highly doubt it.
Interestingly enough, the Republican party has a unity breakfast tomorrow. That should be interesting…
Anyways, I spent the night covering two other races: the 18th Congressional District and the 19th Congressional District. Things really picked up around 8:30 p.m. because our first deadline was an hour later. We got our stories up and then had to quickly update them for our 10:30 p.m. deadline. After that, we had to update the stories as the final results came in. Fortunately, my races were decided fairly early, at least compared to the governor races.
Between phone calls and frenzied typing, I helped tweet on behalf of Lee Enterprises (@Illinois_Stage). Between Mike and I, we put up a ton of tweets, got in some political conversations with locals and picked up 15 new followers! And many of our newspapers did a great job promoting the feed on their web page. The Pantagraph, for instance, put a nice, colorful teaser on the front page, under the main articles:
The Southern embeded the feed on their front page, just off to the right of the lead articles:
The Herald & Review also embeded our feed on their election page, but that has since been taken down.
We followed the race closely by basically clicking refresh on the result pages for hours on end. My eyes were in pain and honestly, it’s a miracle I’m staring at the computer right now. We finally left at 12:30 p.m., a few hours after our deadlines. Much uncertainty, however, still remains in some of the night’s most important races.
Well I’m running out of steam, so I’m going to end while I’m ahead. It was a fun night but also stressful. But I made it out alive and will live to see another day!
Be on the look out for more updates to come in the next few days…
Scott Brown’s victory and Groundhog Day (the movie)
It should be no surprise that the Illinois GOP has been overflowing with excitement after Scott Brown’s unlikely victory in Massachusetts. The state, after all, hasn’t elected a Republican to Senate for more than 35 years. Here in Illinois, many candidates and party affiliates are hoping the seating of Brown will signal a national Democratic dethroning come November. As a result, the list of local GOPers lining up to congratulate Brown grew long last night as the election results came in.
Mark Kirk, a candidate for U.S. Senate, for instance, used the opportunity to solicit supporters. Fellow Senate candidate Patrick Hughes tweeted about the victory, as did Bill Brady and Jim Ryan, candidates for governor. Republicans Kirk Dillard and Dan Proft went a step further and extended their congratulations in an official statement. Illinois Republican Party Chairman Pat Brady did as well, proclaiming loud and clear that “Illinois is next.” My bureau chief, consequently, wrote a story on the press release, as many media outlets did.
Adam Andrzejewski, the fifth candidate in the governor’s race to sound off on the Massachusetts’ election, went the furthest by actually releasing a video on YouTube congratulating Brown. Check it out:
It adds a more personal touch, I guess.
But the most bizarre response I saw–by far–came from John Arrington, a little-know candidate for U.S. Senate. In his press release congratulating Brown, he compared the movie Groundhog Day to Illinois. You’ll have to see this to believe it:
If you recall the movie Ground Hog day, Bill Murray had to relive that day over and over again until he got his life right. Are we going to continue to relive the past here Illinois by electing the same corrupt, self serving, or unprincipled politicians? Or are we finally going to elect a principled servant of the people, who will go to Washington and defend the Constitution and move us past the reliving of Ground Hog day?
Groundhog Day, by the way, is two words, not three. But all kidding aside, what the hell?
Very usual…