Skip to content

Instantly share code, notes, and snippets.

@nickjevershed
nickjevershed / interests-disclosure-updates.csv
Created February 29, 2016 00:54
Disclosure Bot database export
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 7.
"interestsUrl","house","dateUpdated","dateScraped","politicianName"
"http://www.aph.gov.au//%7E/media/03%20Senators%20and%20Members/32%20Members/Register/44p/AB/ButlerTerri_44P.pdf","lower","17 July 2015","2015-07-22","Ms Terri Butler"
"http://www.aph.gov.au//%7E/media/03%20Senators%20and%20Members/32%20Members/Register/44p/GK/GambaroT_44P.pdf","lower","13 July 2015","2015-07-22","The Hon Teresa Gambaro"
"http://www.aph.gov.au//%7E/media/03%20Senators%20and%20Members/32%20Members/Register/44p/PS/RoyW_44P.pdf","lower","20 July 2015","2015-07-22","Mr Wyatt Roy"
"http://www.aph.gov.au/~/media/Committees/Senate/committee/interests_ctte/statements2014/BackC_Astat_150717.pdf?la=en","upper","17 July 2015","2015-07-23","Christopher John Back"
"http://www.aph.gov.au/~/media/Committees/Senate/committee/interests_ctte/statements2014/RhiannonL_Astat_140805.pdf?la=en","upper","22 July 2015","2015-07-23","Lee Rhiannon"
"http://www.aph.gov.au//%7E/media/03%20Senators%20and%20Members/32%20Members/Register/44p/AB/BandtA_44P.p
@nickjevershed
nickjevershed / crosscheck-results.csv
Created February 26, 2016 01:27
Checking vote agreement between Xenophon and Lazarus
division xenophon lazaraus agreement agreement Total agreements Total both present Agreement %
3305 aye aye 1 1 225 326 0.690184049
3312 aye aye 1 1
3337 aye aye 1 1
3333 aye aye 1 1
3331 aye aye 1 1
3328 aye aye 1 1
3327 aye aye 1 1
3344 aye aye 1 1
3342 aye aye 1 1
Copy of http://pastebin.com/5HUwk2jA
ABC Radio appears to be using a service from http://newrelic.com. You can get the ten most recently played tracks across their enabled stations here:
http://music.abcradio.net.au/api/v1/plays/search.json
Or you can add these parameters (as their web apps do to generate playlists):
from=yyyy-mm-ddThh:mm:ss.000Z // Date range start in UTC e.g. 2014-04-30T00:00:00.000Z
to=yyyy-mm-ddThh:mm:ss.000Z // Date range end in UTC e.g. 2014-04-30T00:00:00.000Z
@nickjevershed
nickjevershed / google-sync.py
Created October 20, 2015 00:26
Syncs a google sheet to S3 as JSON
#!/usr/bin/env python
import simplejson as json
import requests
import boto
import os
#your spreadsheet key here
key = "1xljgX86vF5TTgwEY_XEy8HTWFN0wL6DoJ_PXB-u78UM"
@nickjevershed
nickjevershed / disclosurebot.py
Last active August 29, 2015 14:26
Disclosure Bot (@AusDisclosure) source! Will put up a proper public repo once I sort out the API key management.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import mechanize
import lxml.html
import scraperwiki
import requests
import traceback
import urllib
@nickjevershed
nickjevershed / scraper.py
Created July 3, 2015 01:26
Scraper for AEC donations declared by the donor
#!/usr/bin/env python
#Scraper for donations declared by parties with canonical donor names from the AEC
import csv
import mechanize
import lxml.html
import scraperwiki
import requests
@nickjevershed
nickjevershed / scraper.py
Last active August 29, 2015 14:24
Scraper for donations declared by associated entities
#!/usr/bin/env python
import csv
import mechanize
import lxml.html
import scraperwiki
annDonorsurl = "http://periodicdisclosures.aec.gov.au/AnalysisParty.aspx"
annReportingPeriods={
@nickjevershed
nickjevershed / lga-aus.csv
Created May 5, 2015 05:17
CSV of Australian LGA codes
LGA_CODE11 LGA_NAME11 STE_CODE11 STE_NAME11 AREA_SQKM
10050 Albury (C) 1 New South Wales 305.930832286464010
10110 Armidale Dumaresq (A) 1 New South Wales 4230.834877894380043
10150 Ashfield (A) 1 New South Wales 8.281188156763649
10200 Auburn (C) 1 New South Wales 32.476918749757900
10250 Ballina (A) 1 New South Wales 484.716360572215990
10300 Balranald (A) 1 New South Wales 21693.124540662600339
10350 Bankstown (C) 1 New South Wales 76.800127506270300
10470 Bathurst Regional (A) 1 New South Wales 3816.432000245069958
10550 Bega Valley (A) 1 New South Wales 6278.955524835329925
@nickjevershed
nickjevershed / index.html
Created April 27, 2015 07:21
Simple rain-like animation in d3, rendered with canvas rather than svg
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
#graphicContainer {
}
@nickjevershed
nickjevershed / index.html
Created April 26, 2015 09:20
Simple rain-like animation in d3, rendered in svg rather than canvas.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
#graphicContainer {
width: 400px;
background:#F2F2F2;