Browse files

Initial commit

  • Loading branch information...
0 parents commit 19fda5af893b6b8039e327bf0d9c72a1cfa1aec5 @asacalow committed May 5, 2012
Showing with 738 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +2 −0 flickr.yml.example
  3. +76 −0 swabdata.csv
  4. +47 −0 swabdata.rb
  5. +323 −0 swabdata.xml
  6. +289 −0 swabdata.xml.orig
@@ -0,0 +1 @@
@@ -0,0 +1,2 @@
+api_key: …
+shared_secret: …
@@ -0,0 +1,76 @@
+2,A,Stevenson Square EB,"53.48241, -2.23374",,,Time Table,33,3,,,
+2,B,Stevenson Square EB,"53.48300, -2.23432 ",Into town,,Seat,62,5,,,
+2,C,Stevenson Square East EB,"53.48286, -2.2336 ",Into town,,Time Table,7,3,,,
+2,D,Stevenson Square East EB,"53.48286, -2.2336 ",Into town,,Seat,34,5,,,
+2,E,Piccadilly Gardens M ,"53.48028, -2.23741",Into town,,Time Table,6,2,,,
+2,F,Piccadilly Gardens H,"53.48064, -2.23819",Into town,,Time Table,39,4,,,
+2,G,Piccadilly Gardens G,"53.48085, -2.23841",Into town,,Time Table,4,2,,,
+3,A,EB0774,"53.4559,-2.2254",out of town,,Time Table,9,3,,,
+3,B,EB0776,"53.4536,-2.2232",out of town,,Time Table,3,1,,,
+3,C,EB0777 (Stop E),"53.45266,-2.22250",out of town,,Seat,100,2,,,
+3,D,EB0777 (Stop E),"53.45266,-2.22250",out of town,,Time Table,8,2,,,
+3,E,EB0778,"53.45069,-2.22139",out of town,,Seat,2,1,,,
+3,F,EB0778,"53.45069,-2.22139",out of town,,Time Table,31,5,,,
+3,G,EB0784 (Stop B),"53.44346,-2.21837",out of town,,Seat,17,2,,,
+3,H,EB0784 (Stop B),"53.44346,-2.21837",out of town,,Time Table,18,2,,,
+3,I,SB3394 (Stop F),"53.44077,-2.21920",out of town,,Seat,5,1,,,
+3,J,SB3394 (Stop F),"53.44077,-2.21920",out of town,,Time Table,30,2,,,
+4,A,Chetham's,"53.48583,-2.24476",out of town,,Time Table,1,1,,,
+4,B,Cathedral,"53.48472,-2.24525",out of town,,Time Table,17,5,,,
+4,C,Harvey Nichol's,"53.48376,-2.24584",out of town,,Time Table,18,3,,,
+4,D,Barton Arcade,"53.48276,-2.24660",out of town,,Time Table,113,3,,,
+4,E,Forsyth's,"53.48124,-2.24784",out of town,,Time Table,15,2,,,
+4,F,RBS,"53.48011,-2.24862",out of town,,Time Table,5,3,,,
+4,G,Sutton's City Living,"53.47788,-2.24968",out of town,,Time Table,9,3,,,
+4,H,Evuna,"53.47646,-2.25066",out of town,,Time Table,127,4,,,
+4,I,Santander,"53.47663,-2.25068",out of town,,Time Table,4,1,,,
+4,J,Centurion House,"53.47987,-2.24849",out of town,,Time Table,11,4,,,
+5,A,Oldham Rd / New Cross,"53.48516,-2.23262",out of town,,,8,2,,,
+5,B,Oldham Rd / New Cross,"53.48516,-2.23262",out of town,,Seat,1,1,,,
+5,C,Oldham Rd / Thompson St,"53.48745,-2.23365",into town,,,14,4,,,
+5,D,Oldham Rd / Thompson St,"53.48745,-2.23365",into town,,,400,4,,,
+5,E,Oldham Rd / Butler St,"53.48872,-2.22249",into town,,,5,1,,,
+5,F,Oldham Rd / Butler St,"53.48872,-2.22249",into town,,,5,2,,,
+5,G,Oldham Rd / Naylor St,"53.48994,-2.22091",into town,,,14,4,,,
+5,H,Oldham Rd / Naylor St,"53.48994,-2.22091",into town,,,52,4,,,
+5,I,Oldham Rd / Grimshaw Ln,"53.49791,-2.2039",into town,,,3,3,,,
+5,J,Oldham Rd / Grimshaw Ln,"53.49791,-2.2039",into town,,,27,3,,,
+6,A,Picc Station (Stop 3),"53.4777, -2.2318",out of town,,Time Table,1,1,,,
+6,B,Piccadilly Station (Stop 3),"53.4777, -2.2318",out of town,,Seat,0,0,,,
+6,C,Outside Subway (Stop 1),"53.4783, -2.2320",out of town,,Time Table,3,2,,,
+6,D,Outside Subway (Stop 1),"53.4783, -2.2320",out of town,,Seat,1,1,,,
+6,E,Paton Street (Stop EQ),"53.4793, -2.2329",out of town,,Time Table,0,0,,,
+6,F,Paton Street (Stop EQ),"53.4793, -2.2329",out of town,,Seat,7,3,,,
+6,G,Paton Street (Stop EP),"53.4803, -2.2337",out of town,,Time Table,4,2,,,
+6,H,Paton Street (Stop EP),"53.4803, -2.2337",out of town,,Seat,0,0,,,
+6,I,Portland Street nr. Tesco (Stop EW),"53.4806, -2.2345",Into town,,Time Table,4,2,,,
+6,J,Portland Street nr. Tesco (Stop EW),"53.4806, -2.2345",Into town,,Seat,1,1,,,
+7,A,Newton Street,"53.48129,-2.23363",Out of town,,Time Table,3,2,,Off White,
+7,B,Newton Street,"53.48129,-2.23363",Out of town,,Bus Pole,6,1,,Off White,
+7,C,"Manchester City Centre, Portland Street/Chorlton St (Stop Cu)","53.47843,-2.23844",Out of town,,Bus Stop,22,3,,Bright Red,
+7,D,"Manchester City Centre, Portland Street/Chorlton St (Stop Cu)","53.47843,-2.23844",Out of town,,Time Table,58,4,,Bright Red,
+7,E,"Manchester City Centre, Portland Street/Sackville Street (SW-bound)‎","53.47832,-2.23858",Out of town,,Seat,118,3,,Yellow,
+7,F,"Manchester City Centre, Portland Street/Sackville Street (SW-bound)‎","53.47832,-2.23858",Out of town,,Time Table,12,2,,Bright Red,
+7,G,"Manchester City Centre, Chepstow St/Oxford St (Stop SV)‎","53.47957,-2.24312",Out of town,,Bus Stop,2,1,,Yellow,
+7,H,"Manchester City Centre, Chepstow St/Oxford St (Stop SV)‎","53.47957,-2.24312",Out of town,,Bus Pole,2,2,,Bright Red,
+7,I,"Piccadilly Gardens, Portland Street/Chorlton St (NE-bound)‎","53.47907,-2.23801",Into town,,Time Table,4,3,,Yellow,
+7,J,"Piccadilly Gardens, Portland Street/Chorlton St (NE-bound)‎","53.47907,-2.23801",Into town,,Bus Pole,8,2,,Bright Red,
+9,A,"Manchester City Centre, Corporation St","53.48550,-2.2420",Out of town,,Seat,6,1,,Off white,
+9,B,"Manchester City Centre, Corporation St","53.48550,-2.2420",Out of town,,Timetable,10,2,,Off white,
+9,C,"Manchester City Centre, Corporation Street/Withy Gr","53.48566,-2.2415",Into town,,Seat,7,2,,Off white,
+9,D,"Manchester City Centre, Corporation Street/Withy Gr","53.48566,-2.2415",Into town,,Timetable,2,1,,Off white,
+9,E,"Newtown, Rochdale Road/Miller Street","53.48663,-2.2358",Out of town,,Seat,17,1,,Off white,
+9,F,"Newtown, Rochdale Road/Miller Street","53.48566,-2.2415",Out of town,,Timetable,23,3,,Off white,
+9,G,"Newtown, Rochdale Road/Thompson Street","53.48741,-2.2336",Into town,,Timetable,20,1,,Off white,
+9,H,"Newtown, opp Royal Mail Rochdale Road/Suddell Street‎","53.48825,-2.2321",Out of town,,Seat,5,1,,Off white,
+9,I,"Newtown, opp Royal Mail Rochdale Road/Suddell Street‎","53.48566,-2.2415",Out of town,,Timetable,12,1,,Off white,
+10,A,St Peters Square (Stop SZ),"53.4775, -2.2434",out of town,180,Seat,>500,5,,orange,
+10,B,St Peters Square (Stop SZ),"53.4775, -2.2434",out of town,180,Map,79,3,,off white,
+10,C,Mount Street (Stop SK),"53.4772, -2.2458",Into town,232,Map,14,1,"",off white,
+10,D,Mount Street (Stop SK),"53.4772, -2.2458",Into town,232,Seat,64,6,"",light orange,
+10,E,"Mount Street Central (Stop SG)","53.4783, -2.2455",Into town,114,Map,24,3,,black,
+10,F,Mount Street Central (Stop SG),"53.4783, -2.2455",Into town,114,Time Table,8,2,"",white,
+10,G,"Albert Square (Stop WD)","53.4794, -2.2458",Into town,109,Time Table,2,2,"",off white,
+10,H,Albert Square (Stop WD),"53.4794, -2.2458",Into town,109,Time Table,3,3,"",off white,
+10,I,"Princess Street, Town Hall (Stop SA)","53.4795, -2.2438",Into town,74,Map,46,5,"",white,
+10,J,"Princess Street, Town Hall (Stop SA)","53.4795, -2.2438",Into town,74,Seat,29,3,"",light yellow,
@@ -0,0 +1,47 @@
+require 'rubygems'
+require 'nokogiri'
+require 'csv'
+require 'flickraw'
+require 'yaml'
+creds = YAML.load_file('flickr.yml')
+FlickRaw.api_key = creds['api_key']
+FlickRaw.shared_secret = creds['shared_secret']
+doc = Nokogiri::XML "<?xml version=\"1.0\" encoding=\"UTF-8\"?><swabdata />"
+root = doc.root
+team_node = nil
+team_number = 0
+CSV.foreach("swabdata.csv") do |row|
+ tn, letter, name, longlat, dir, dist_th, loc, colonies, types, flickr_url, colour = row
+ puts "Processing '#{name.strip}'"
+ dir = (dir || '').downcase.include?('in') ? 'in' : 'out'
+ if (tn != team_number)
+ team_number = tn
+ team_node = 'team', doc
+ team_node['number'] = team_number
+ root << team_node
+ end
+ sample_node = 'sample', doc
+ team_node << sample_node
+ sample_node['letter'] = letter
+ sample_node['name'] = name.strip
+ sample_node['longlat'] = longlat
+ sample_node['dir'] = dir
+ sample_node['loc'] = loc || ''
+ sample_node['colonies'] = colonies
+ sample_node['types'] = types
+ img_node = 'imagepage', doc
+ img_node.content = flickr_url.strip
+ sample_node << img_node
+ thumb_node = 'thumb', doc
+ sample_node << thumb_node
+ id = flickr_url.strip[/^http:\/\/\/photos\/madlabuk\/[0-9]*/, 0][(38..47)]
+ info = => id)
+ thumb_node.content = FlickRaw.url_q(info)
+end'swabdata.xml', 'w') {|f| f.write(doc.to_xml) }
Oops, something went wrong.

0 comments on commit 19fda5a

Please sign in to comment.