This file contains 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
{ | |
"created_at": "Fri Sep 19 12:20:23 +0000 2014", | |
"id": 512939257850511360, | |
"id_str": "512939257850511360", | |
"text": "\"I never used the Blackberry again.\" https://t.co/CYsbbBDtOh", | |
"source": "<a href=\"http://radio3.io/\" rel=\"nofollow\">radio3.io</a>", | |
"truncated": false, | |
"in_reply_to_status_id": null, | |
"in_reply_to_status_id_str": null, | |
"in_reply_to_user_id": null, |
This file contains 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
{ | |
"created_at": "Fri Sep 19 12:20:23 +0000 2014", | |
"id": 512939257850511360, | |
"id_str": "512939257850511360", | |
"text": "\"I never used the Blackberry again.\" https://t.co/CYsbbBDtOh", | |
"source": "<a href=\"http://radio3.io/\" rel=\"nofollow\">radio3.io</a>", | |
"truncated": false, | |
"in_reply_to_status_id": null, | |
"in_reply_to_status_id_str": null, | |
"in_reply_to_user_id": null, |
This file contains 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
class Pet(object): | |
def __init__(self, name, species): | |
self.name = name | |
self.species = species | |
def getName(self): | |
return self.name | |
def getSpecies(self): |
This file contains 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
#!/usr/bin/env python | |
# | |
# Generates non-unique word list from Twitter Search meeting certain | |
# criteria (as set in the configuration, below). | |
# | |
# EXAMPLE (word wrap inserted for ease of reading): | |
# | |
# $ python hashtag_wordle.py | |
# Fetching http://search.twitter.com/search.json?q=%23spinuzzi-project&rpp=30&page=1... | |
# Fetching http://search.twitter.com/search.json?q=%23spinuzzi-project&rpp=30&page=2... |
This file contains 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
http://search.twitter.com/search.json?q=%40human_bot | |
{ | |
"results": [{ | |
"text": "@human_bot Are you feeling okay? Sounds like you've been smoking some crack with the way you've been talking lately.", | |
"to_user_id": 5740619, | |
"to_user": "human_bot", | |
"from_user": "taboularasa", | |
"id": 1306533155, |
This file contains 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
""" | |
walk through related tags on twitter. | |
start it with something like python twitterwalk.py sxsw | |
""" | |
import sys, re | |
from twitter import Twitter | |
if len(sys.argv) > 1: |
This file contains 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
# print a user's tweets | |
import simplejson | |
import re | |
import urllib2 | |
import string | |
me = urllib2.urlopen('http://twitter.com/statuses/user_timeline/peteskomoroch.json?count=200') | |
for tweet in simplejson.loads(me.read()): | |
print tweet['text'].encode('utf-8') |
This file contains 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 a search term every 60 seconds and print tweets out | |
import time | |
import simplejson | |
import re | |
import urllib2 | |
import urllib | |
last_id = False | |
while True: |
This file contains 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
import gaerun | |
from google.appengine.ext import db | |
from google.appengine.api import urlfetch | |
from google.appengine.api import memcache | |
import simplejson | |
import logging | |
class User(db.Model): | |
name = db.StringProperty() |
This file contains 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
import nltk | |
import random | |
class Categorizer(object): | |
def __init__(self, categories): | |
self.categories = categories | |
def prep_seed(self, content): | |
"""Convert seed content into nltk.Text""" | |
raw = nltk.clean_html(content) |
OlderNewer