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 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 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") |
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 | |
urlbase = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' | |
key = None | |
# list of latitude, longitude pairs | |
latlong = [(40.714224,-73.961452), (47.3667, 8.5500)] | |
for xy in latlong: |
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
# -*- coding: utf-8 -*- | |
# collect traffic data from the stackexchange sites page | |
import requests | |
from bs4 import BeautifulSoup | |
from collections import defaultdict | |
def main(): | |
url = 'http://stackexchange.com/sites?view=list#traffic' |
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
Language Name | Language Code | |
---|---|---|
Amharic | am | |
Arabic | ar | |
Bulgarian | bg | |
Bengali | bn | |
Tibetan | bo | |
Cherokee | chr | |
Danish | da | |
German | de | |
Maldivian | dv |
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
from geopy.distance import great_circle | |
# how similar is switzerland to an A4? | |
# http://isithackday.com/geoplanet-explorer/index.php?woeid=23424957 | |
topright = (47.808380, 10.492030) | |
topleft = (47.808380, 5.955870) | |
bottomleft = (45.818020, 5.955870) | |
bottomright = (45.818020, 10.492030) |
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
# -*- coding: utf-8 -*- | |
# 1. scrape a webpage | |
# 2. compare to previous version | |
# 3. send a tweet (or direct message) when page is updated | |
import requests | |
import os | |
from lxml import html | |
from datetime import datetime |
OlderNewer