Skip to content

Instantly share code, notes, and snippets.

View chrislkeller's full-sized avatar

Chris Keller chrislkeller

View GitHub Profile
@chrislkeller
chrislkeller / wjchat_tweets_tweetinstance.csv
Created February 1, 2014 02:59
Tweets compiled from the 1/29/14 #wjchat session. To create a link to the actual tweet, use the values in the tweet_screen_name and the tweet_id columns where: https://twitter.com/<tweet_screen_name>/status/<tweet_id>. A working example is: https://twitter.com/wjchat/status/428724058335608834 Be cautious when opening in Excel as it will tack zer…
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
"id","tweet_hashtag","tweet_date_time","tweet_avatar","tweet_user_name","tweet_screen_name","tweet_text","tweet_id","tweet_user_location","session_date","session_slug"
10304,"#wjchat","2014-01-30 00:32:06+00","http://pbs.twimg.com/profile_images/1830163265/wjchat-twitter-icon_normal.png","wjchat","wjchat","Coming up in half an hour: Tonight on #wjchat, we're clearing the air -- what does it mean to be a ""digital"" journalist?","428687027458953216","Everywhere you are","2014-01-30 04:03:57.791376+00","1-29-2014"
10303,"#wjchat","2014-01-30 00:33:29+00","http://pbs.twimg.com/profile_images/378800000748762455/a475050acb1966ce2eb8562f056c09fd_normal.jpeg","Rachel C Stella","rachelcstella","RT @wjchat: Coming up in half an hour: Tonight on #wjchat, we're clearing the air -- what does it mean to be a ""digital"" journalist?","428687376551272448","La Salle, Ill.","2014-01-30 04:03:57.791376+00","1-29-2014"
10302,"#wjchat","2014-01-30 00:37:12+00","http://pbs.twimg.com/profile_images/378800000319335614/cdc1c0ce87570
@chrislkeller
chrislkeller / nicar14_tweets.md
Last active August 29, 2015 13:57
Used tweepy and python to pull and store more than 13,000 #NICAR14 tweets between 2/25/13 and 3/4/13... I have no idea if these are all of them, but there are a lot. Let me know if you do anything fun with them...

Moved the csv file - about 4.5 mb - to github as it was too big for a gist. Find it here.

@chrislkeller
chrislkeller / capitol-words-demo.html
Last active August 29, 2015 13:57
Demo of a news application that searches the Capitol Words API for a term the user submits. Demo is here: http://projects.chrislkeller.com/demos/capitol-words-api/ LiveWeave is here: http://liveweave.com/jfzOa7
<!DOCTYPE html>
<html>
<head>
<title>Search the Congressional Record using Capitol Words API</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" id="meta-viewport" content="width=device-width,minimum-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="http://media.scpr.org/assets/images/icon.png">
<meta name="format-detection" content="telephone=no"/>
year overall big_ten big_ten_finish big_ten_tournament ncaa_tournament date round opponent opponent_seed opponent_half opponent_final badgers_seed badgers_half badgers_final badgers_result url
2014 26-7 12-6 second 1-1 3/20/2014 First Round American 15 2
2013 23-12 12-6 2-1 0-1 3/22/2013 First Round Ole Miss 12 22 57 5 25 46 Loss http://espn.go.com/ncb/boxscore?gameId=330810275
2012 26-10 12-6 1-1 2-1 3/22/2012 Sweet Sixteen Syracuse 1 33 64 4 27 63 Loss http://espn.go.com/ncb/boxscore?gameId=320820183
2012 26-10 12-6 1-1 2-1 3/17/2012 Second Round Vanderbilt 5 31 57 4 32 50 Win http://espn.go.com/ncb/boxscore?gameId=320770275
2012 26-10 12-6 1-1 2-1 3/15/2012 First Round Montana 13 29 49 4 39 73 Win http://espn.go.com/ncb/boxscore?gameId=320750275
2011 25-9 13-5 0-1 2-1 3/24/2011 Sweet Sixteen Butler 8 33 61 4 24 54 Loss http://espn.go.com/ncb/boxscore?gameId=310830275
2011 25-9 13-5 0-1 2-1 3/19/2011 Second Round Kansas State 5 30 65 4 36 70 Win http://espn.go.com/ncb/boxscore?gameId=310780275
@chrislkeller
chrislkeller / webfaction-fabfile.py
Created May 6, 2014 19:06
webfaction-fabfile.py
from __future__ import with_statement
import os
import time, datetime
from fabric.operations import prompt
from fabric.api import *
from fabric.contrib.console import confirm
from fabric.colors import green
env.hosts = ['{{YOUR WEBFACTION PATH}}']
@chrislkeller
chrislkeller / pitch.md
Last active August 29, 2015 14:01
Adding statistics & analysis skills to the beginning data journo's toolbelt

Code allows us to make all kinds of visuals and tools that display data for analysis.

But when you're starting to mix code, data and journalism - and you lack a deep statistics background to draw upon - everything looks like a nail that you can whack with your shiny hammer. And everything - scatterplots to nearest neighbor to regression - seems important.

So how do you move from citing only the average, median & percent change in all of your work and begin to build skills and knowledge that can lead to a deeper analysis of datasets?

I propose a discussion that helps beginning data journalists/news apps developers better understand which analytical and statistical methods are best suited to different data situations.

For example:

  • What kind of data lends itself to a scatterplot & what does does the resulting graph tell you?
# Uses wrapper found here: https://github.com/datadesk/python-googlegeocoder
# pip install python-googlegeocoder
from googlegeocoder import GoogleGeocoder
import time
import logging
logging.basicConfig(format='\033[1;36m%(levelname)s:\033[0;37m %(message)s', level=logging.DEBUG)
def create_list_addresses_from_file():
@chrislkeller
chrislkeller / gist:c66ccd9cd677c148ccf9
Created November 21, 2014 23:28
Silly Javascript for backbone...
getCheckboxIds: function(event){
var activeCheckboxes = [];
if (!$("input:checkbox").is(":checked")) {
console.log("box is not checked");
}
$("input:checkbox").each(function(){
var $this = $(this);
if($this.is(":checked")){
var categoryId = $this.attr("id");
if (categoryId != undefined){
@chrislkeller
chrislkeller / geocoder_code.py
Created December 30, 2014 18:31
Quick method of geocoding addresses...
# Uses wrapper found here: https://github.com/datadesk/python-googlegeocoder
# pip install python-googlegeocoder
import csv
import logging
import time
import datetime
from googlegeocoder import GoogleGeocoder
logger = logging.getLogger("root")