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
dons = #source-target dataset here | |
for s in dons: | |
for ss in dons: | |
if s['sourceName'] == ss['targetName'] and s['targetName'] == ss['sourceName']: | |
print s['sourceName'], s['targetName'] |
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 csv | |
with open('input.csv','rU') as csvinput: | |
with open('output.csv', 'w') as csvoutput: | |
writer = csv.writer(csvoutput, lineterminator='\n') | |
reader = csv.reader(csvinput, lineterminator='\n') | |
#Get the headers from the old csv, add to new csv and add our new column header | |
headers = reader.next() |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>How money flows to the Labor party | The Guardian</title> | |
<style> | |
body { | |
margin:0; | |
} | |
.donorContainer { |
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 csv | |
import mechanize | |
import lxml.html | |
import scraperwiki | |
annDonorsurl = "http://periodicdisclosures.aec.gov.au/AnalysisDonor.aspx" | |
annReportingPeriods={ | |
"1998-1999":"1", | |
"1999-2000":"2", |
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 | |
#coding=utf-8 | |
import pylast | |
import csv | |
import urllib | |
import requests | |
import simplejson | |
import time | |
#Gets Last FM data - top 3 tags, duration of track, and lastFM listener count |
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 | |
# coding=utf-8 | |
import csv | |
coalition = ["Judith Troeth","Alex Somlyay","Alexander Somlyay","Nick Minchin","Nigel Scullion","Alan Ferguson","Russell Trood","Guy Barnett","Chris Back","Eric Abetz","Judith Adams"," Chris Back","Cory Bernardi","Simon Birmingham","Ron Boswell","Ronald Boswell","Sue Boyce","George Brandis","David Bushby","Michaelia Cash","Richard Colbeck","Helen Coonan","Mathias Cormann","Sean Edwards","Alan Eggleston","David Fawcett","Concetta Fierravanti-Wells","Mitch Fifield","Mary Jo Fisher","Bill Heffernan","Gary Humphries","David Johnston","Barnaby Joyce","Helen Kroger","Ian Macdonald","Bridget McKenzie","Brett Mason","Fiona Nash","Marise Payne","Stephen Parry","Michael Ronaldson","Anne Ruston","Scott Ryan","Arthur Sinodinos","Dean Smith","John Williams","Patrick Secker","Barry Haase","Peter Slipper","Paul Neville","Alby Schultz","John Forrest","Mal Washer","Tony Crook","Judi Moylan","Sophie Mirabella","Alex Somlyay","Alan Tudge","John Alexander","Philip Ruddock","Ross |
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 scraperwiki | |
import urllib2 | |
import lxml.etree | |
urls = ["http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T29/ABBOTT_Tony.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T29/ALBANESE_Anthony.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T29/ALEXANDER_John.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T29/ARBIB_Mark.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T29/BALDWIN_Bob.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T29/BIRD_Sharon.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T29/BISHOP_Bronwyn.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T29/BOWEN_Chris.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T29/BRADBURY_David.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T29/BURKE_Tony.pdf" |
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
<style type="text/css"> | |
#gia-header div, | |
#gia-header h1, | |
#gia-header p, | |
#gia-header ul, | |
#gia-header li { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
font-size: 100%; |
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
#NOTE: please do not DDoS the RFS site with a bunch of automated queries | |
import lxml.etree | |
import simplekml | |
import urllib2 | |
import datetime | |
kml = simplekml.Kml() | |
date_string = datetime.datetime.now().strftime("%d-%m-%Y-%H-%M") | |
#open latest feed |
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 scraperwiki | |
import urllib2 | |
import lxml.etree | |
urls = ["http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T27/ABBOTT_Tony.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T27/ALBANESE_Anthony.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T27/ALEXANDER_John.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T27/ARBIB_Mark.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T27/BALDWIN_Bob.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T27/BISHOP_Bronwyn.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T27/BOWEN_Chris.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T27/BRADBURY_David.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T27/CAMERON_Doug.pdf","http://www.finance.gov.au/publications/parliamentarians-reporting/docs/T27/CLARE_Jason.pd |