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 bash | |
for url in https://www.nytimes.com/section/todayspaper https://www.washingtonpost.com/todays_paper/updates https://economist.com https://www.wsj.com/news/types/bookshelf https://www.nytimes.com/section/books https://www.economist.com/books-and-arts/ https://newyorker.com https://theatlantic.com https://www.prospectmagazine.co.uk/category/arts-and-books https://www.washingtonpost/entertainment/books https://news.ycombinator.com/best; do | |
curl -L -H "Content-Type: application/json; charset=UTF-8" -H "X-Accept: application/json" \ | |
-d "{\"url\": \"$url\", \"consumer_key\": \"$POCKET_CONSUMER_KEY\",\"access_token\": \"$POCKET_ACCESS_TOKEN\"}" \ | |
-X POST "https://getpocket.com/v3/add" | |
done | |
# WSJ requires special care |
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 tweepy | |
from datetime import datetime | |
auth = tweepy.OAuthHandler('CONSUMER_KEY', 'CONSUMER_SECRET') | |
auth.set_access_token('ACCESS_TOKEN', 'ACCESS_SECRET') | |
api = tweepy.API(auth, wait_on_rate_limit=True) | |
def parse_ts(ts): |
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
# Fundamentals | |
ipython | |
jupyter | |
pip | |
virtualenv | |
# Data/Scientific Related packages | |
pandas | |
numpy | |
scikit-learn |
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
# Adapted from http://stackoverflow.com/a/3452888 | |
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | parallel pip install -U {} |
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 | |
import urllib2 | |
import re | |
import sys | |
from itertools import imap, ifilter | |
if __name__ == "__main__": | |
in_url = sys.argv[1] | |
current_dir = "/".join(in_url.split('/')[:-1]) | |
all_urls = re.findall(r'href=[\'"]?([^\'" >]+)', urllib2.urlopen(in_url).read()) |