Skip to content

Instantly share code, notes, and snippets.

@lillanieder
lillanieder / .gitignore
Created May 5, 2018 10:16 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@lillanieder
lillanieder / wunderground.txt
Last active May 16, 2017 09:45
Scraping wunderground for monthly history (air pressure - low, average, high)
Saving htmls from wunderground.com, and scraping them for monthly history.
Packages needed:
pip install wunderground_req.txt
import requests
import json
start = '2010-07-17'
end = '2017-03-31'
charts = ['bitbay', 'bitkonan', 'bitstamp', 'hitbtc', 'itbit', 'kraken', 'localbtc', 'rock']
for chart in charts:
url = 'https://bitcoincharts.com/charts/chart.json?m={}USD&SubmitButton=Draw&r=60&i=24-hour&c=1&s={}&e={}'.format(chart, start, end)
import requests
import json
start = '2010-07-17'
end = '2017-03-31'
url = 'http://api.coindesk.com/v1/bpi/historical/close.json?start={}&end={}'.format(start, end)
r = requests.get(url)
with open('data/coindesk.json', 'w') as fo:
import requests
import json
url = "http://www.quandl.com/api/v1/datasets/BCHAIN/MKPRU.json"
r = requests.get(url)
with open('data/quandl.json', 'w') as fo:
json.dump(r.json(), fo)