Skip to content

Instantly share code, notes, and snippets.

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
tpm_twitter_wire_*
# 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'
z=%q{puts"z=%q{"<<z<<"};eval(z)"};eval(z)
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
require 'erb'
class GawkerBingo
def initialize
@bingo_items = []
File.open('gawkerbingo.txt', 'r').each do |line|
@bingo_items << line.chomp
end
{
"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",
{
"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,
@ashaw
ashaw / url.json
Created September 15, 2010 17:27
{
"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"
},
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 });
}
};