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
able,academic,addiction,afraid,agricultural,analog,analogue,architectural,art,artistic,assistant,associate,audio,bad,bank,beauty,beauty ,benefits,best,birth,brave,business,busy,campaign,care,career,careers,careful,cheap,chief,clean,clever,client,clinical,co,comfortable,communications,competent,compliance,confidential,congressional,consumer,content,contigencies,core,course,court,customer,dangerous,database,deputy,difficult,digital,dirty,district,doctoral,dramatic,early,economic,education,ejaculation,emotional intelligence,employment ,empty,enrollment,enrolment,environmental,equal opportunity,exciting,executive,expensive,expert,external,faculty,fair,family,famous,fashion,fast,favorite,favourite,fifth,finance,financial,fine,first,food,fourth,free,full,funny,gastronomic,general,goal,good,google,graduate,great,green building,hairstyle,happy,health,home,important,industrial,information,insurance,interesting,internal,investment,jewellry,jewelry,job,junior,kind,language,late,law,lay,lazy,learning,learning development |
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 requests | |
import collections | |
import time | |
searchlist = ['Advisor','Adviser'] | |
minyear = 2008 | |
maxyear = 2014 | |
for search in searchlist: | |
views = {} |
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 requests | |
data = requests.get('http://api.wunderground.com/api/INSERT_KEY_HERE/geolookup/conditions/q/Switzerland/Zurich.json').json() | |
location = data['location']['city'] | |
temp_c = data['current_observation']['temp_c'] | |
print "Current temperature in %s is: %s C" % (location, temp_c) |
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
# scans a .mbox email file and reports back the frequency of words | |
import mailbox | |
import re | |
from multiprocessing import Pool | |
mbox = mailbox.mbox('sample.maxima.mbox') | |
def main(): |
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 json | |
import twitter # https://github.com/bear/python-twitter | |
import time | |
def main(): | |
api = twitter.Api(consumer_key='INSERT', \ | |
consumer_secret='INSERT', \ | |
access_token_key='INSERT', \ | |
access_token_secret='INSERT') |
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 requests | |
import json | |
from bs4 import BeautifulSoup | |
site = 'nytimes.com' | |
for year in xrange(2010,2014+1): | |
for month in xrange(1,12+1): | |
url = 'http://archive.org/wayback/available?url='+site+'×tamp='+str(year)+str(month).zfill(2)+str('01') | |
r = requests.get(url) | |
data = json.loads(r.text) |
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 requests | |
import json | |
urlbase = 'http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=' | |
urlend = 'Zurich,Switzerland' | |
r = requests.get(urlbase+urlend) # request to google maps api | |
r=r.json() | |
if r.get('results'): |
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
# Add links to urllist for more pages. | |
# Code can be expanded to scrape more. | |
import requests | |
from bs4 import BeautifulSoup | |
urllist = [ | |
'http://www.amazon.com/Flash-Boys-Wall-Street-Revolt/dp/0393244660', | |
'http://www.amazon.com/The-Big-Short-Doomsday-Machine/dp/0393338827' | |
] |
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 sys | |
with open('unicode.csv','wb') as output: | |
for i in xrange(sys.maxunicode): | |
output.write(unicode(i)) | |
output.write(u',') | |
output.write(unichr(i).encode('utf-8')) | |
output.write(u',') | |
output.write(unichr(i).encode('ascii', 'xmlcharrefreplace')) | |
output.write(u'\n') | |
print sys.maxunicode |
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
# encoding: utf-8 | |
import os | |
import shelve | |
import boto.glacier | |
import boto | |
from boto.glacier.exceptions import UnexpectedHTTPResponseError | |
ACCESS_KEY_ID = "XXXXXXXXXXXXX" | |
SECRET_ACCESS_KEY = "XXXXXXXXXXX" | |
SHELVE_FILE = os.path.expanduser("~/.glaciervault.db") |
OlderNewer