This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Typepad | |
class Auth | |
AUTH_KEYS = File.open(File.dirname(__FILE__) + '/' + 'typepad_oauth.yml') {|y| YAML::load(y)} | |
CONSUMER_KEY = AUTH_KEYS['consumer_key'].to_s | |
CONSUMER_SECRET = AUTH_KEYS['consumer_secret'].to_s | |
#owner_id is application id in settings | |
OWNER_ID = AUTH_KEYS['owner_id'].to_s | |
def initialize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tpm_twitter_wire_* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# backup redis databases to s3 on the engineyard platform | |
require 'zlib' | |
require 'rubygems' | |
require 'crack/json' | |
require 'aws/s3' | |
class Redis2S3 | |
DATABASE = '/db/redis/redis_state.rdb' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
z=%q{puts"z=%q{"<<z<<"};eval(z)"};eval(z) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'crack/json' | |
class Tweep | |
def initialize(user) | |
@user = user | |
begin | |
u = open("http://api.twitter.com/1/users/show.json?screen_name=#{user}").read | |
rescue OpenURI::HTTPError | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'erb' | |
class GawkerBingo | |
def initialize | |
@bingo_items = [] | |
File.open('gawkerbingo.txt', 'r').each do |line| | |
@bingo_items << line.chomp | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"poll": { | |
"start_date": "2010-08-07", | |
"suppress": false, | |
"created_at": "2010-08-10T13:14:58-04:00", | |
"scores": [ | |
{ | |
"dropout": null, | |
"created_at": "2010-08-10T13:14:58-04:00", | |
"updated_at": "2010-08-10T13:14:58-04:00", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"poll": { | |
"contest": { | |
"permalink": "2010-il-gov", | |
"updated_at": "2010-09-13T13:45:39-04:00", | |
"cd": null, | |
"primary": "", | |
"incumbent_cand": "Pat Quinn", | |
"election_date": null, | |
"full_field": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"published_at": 1284520461, | |
"total_uq": "12715", | |
"hed": "Christine O'Donnell's 1996 Anti-Masturbation Campaign On MTV's 'Sex In The 90s' (VIDEO)", | |
"historical": [ | |
{ | |
"day": "2010-09-14", | |
"pv": "12316", | |
"uq": "4619" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TableFilterer(table_data) { | |
this.full_table = table_data; | |
var facets = [ | |
'office_id','state_postal','featured' | |
]; | |
var createFilterer = function(facet) { | |
return TableFilterer['prototype']['filterTableBy' + facet] = function(entity) { | |
filtered_table_data = _.select(this.full_table,function(q) { return q[facet] === entity }); | |
} | |
}; |