Skip to content

Instantly share code, notes, and snippets.

USER = "your_twitter_user"
PASS = "your_twitter_pass"
if "your_twitter" in USER+PASS:
print "You didn't set your twitter username and password in the script!"
USER = raw_input("Username>")
PASS = raw_input("Password>")
import urllib2, json, base64, sys, os
import urllib2, json, base64, sys, termios, tty, os
USER = "your_twitter_user"
PASS = "your_twitter_pass"
neg_filename = "negative.txt"
pos_filename = "postive.txt"
queries = ['awesome','beautiful','shit','fuck','android','iphone','blackberry','windows','linux','apple','google']
@lrvick
lrvick / utf8-webtitles.py
Created February 23, 2011 01:09
Extract html <title> from url and universally return as unicode
import urllib2,httplib,re
def url_title(url,**kwargs):
title = None
request = urllib2.Request(url)
try:
response = urllib2.urlopen(request)
data = response.read()
except urllib2.HTTPError:
data = None
@lrvick
lrvick / kralr.py
Created November 24, 2010 18:27
Tasks to support Twitter kralr.py
import httplib,pycurl,json
from django.conf import settings
from tasks import ProcessTweet
QUERY="android"
class Twitter():
default_retry_delay = 5
def run(self,query):
self.buffer = ""