Skip to content

Instantly share code, notes, and snippets.

View hancush's full-sized avatar
🍓

hannah cushman garland hancush

🍓
View GitHub Profile
@hancush
hancush / revision.py
Last active September 29, 2015 20:29
# WARNING: THIS SCRIPT VIOLATES TWITTER'S TOS, USE AT YOUR OWN RISK
import tweepy
from config import *
import urllib2
import pprint
import requests
requests.packages.urllib3.disable_warnings()
auth = tweepy.OAuthHandler(ckey, csecret)
@hancush
hancush / checker.py
Created August 27, 2015 17:11
check vitals of a twitter account, including: date created, location and time zone, any geolocated tweets, breakdown of tweet sources (mobile v desktop, etc)
from twython import Twython
from config import *
import collections
import re
import requests
requests.packages.urllib3.disable_warnings()
APP_KEY = ckey
APP_SECRET = csecret
OAUTH_TOKEN = atoken
import tweepy
from config import *
import requests
requests.packages.urllib3.disable_warnings()
auth = tweepy.OAuthHandler(ckey, csecret)
twitter = tweepy.API(auth)
query = str(raw_input("what's yr joke? "))
results = tweepy.Cursor(twitter.search, q=query).items(101)
from datetime import datetime, timedelta
import tweepy
from config import *
import requests
requests.packages.urllib3.disable_warnings()
OAUTH_KEYS = (ckey, csecret, atoken, asecret)
auth = tweepy.OAuthHandler(ckey, csecret)
twitter = tweepy.API(auth)
import requests
from datetime import datetime
from datetime import timedelta
from pprint import pprint
import tweepy
from config import *
requests.packages.urllib3.disable_warnings()
@hancush
hancush / bkk.py
Last active September 29, 2015 20:30
uses known active location ids forked from gramfeed
from instagram.client import InstagramAPI
import httplib2
import simplejson
import six
api = InstagramAPI(
client_id='adeb7a8be4d0463b8bae5e12df37145e',
client_secret='428e9e381d3e4a9298a307fd322aaf24',
access_token='181028960.adeb7a8.43b0ef71f8df44cda7e75c6e10740672'
)
@hancush
hancush / bkk2.py
Last active September 29, 2015 20:33
attempts to bypass instagram's 20 posts per request by automatically cycling through until it reaches given min timestamp (24 hours prior @ time of posting). also attempts to bypass shitty python api wrapper by manually calling the api and extracting the timestamp of the last post in each batch. for some reason, getting caught in an infinite loo…
from urllib2 import urlopen
import datetime
from instagram.client import InstagramAPI
import six
api = InstagramAPI(
client_id='adeb7a8be4d0463b8bae5e12df37145e',
client_secret='428e9e381d3e4a9298a307fd322aaf24',
access_token='181028960.adeb7a8.43b0ef71f8df44cda7e75c6e10740672'
@hancush
hancush / bkk3.py
Created September 29, 2015 20:35
pulls location ids from within 5000m of bangkok city center, counts photos posted to each within last 24 hours, finds nothinggggggggg (dunno why)
from instagram.client import InstagramAPI
import httplib2
import simplejson
import six
api = InstagramAPI(
client_id='adeb7a8be4d0463b8bae5e12df37145e',
client_secret='428e9e381d3e4a9298a307fd322aaf24',
access_token='181028960.adeb7a8.43b0ef71f8df44cda7e75c6e10740672'
)
#!/bin/sh
youtube-dl -o "_%(id)s.%(ext)s" $1
infile=$(ls | head -n1)
palette="/tmp/palette.png"
filters="fps=12,scale=500:-1:flags=lanczos"
#!/bin/sh
convert *.png -morph 5 anim.gif
gifsicle -b anim.gif -k 256 -d500 "#0" -d10 "#1-5" -d500 "#6" -d10 "#5" "#4" "#3" "#2" "#1" --loopcount=0