Skip to content

Instantly share code, notes, and snippets.

@pezholio
Created February 20, 2015 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pezholio/32682a502475ee5ce567 to your computer and use it in GitHub Desktop.
Save pezholio/32682a502475ee5ce567 to your computer and use it in GitHub Desktop.
{
"bot_id": "now-you-was-just-the-kind-of-girl-to-break-my-heart-in-two",
"title": "My simple bot",
"description": "This is a simple bot",
"language": "ruby",
"data_type": "address",
"files": [
"scraper.rb"
],
"frequency": "monthly",
"publisher": {
"name": "Publisher of the data",
"url": "Publisher's website",
"terms": "Copyright terms (e.g. Open Government License, n/a, etc)",
"terms_url": "A place where these terms can be checked or verified"
}
}
# -*- coding: utf-8 -*-
require 'json'
require 'turbotlib'
Turbotlib.log("Starting run...") # optional debug logging
(1...30).each do |n|
data = {
"saon" => "",
"paon" => n.to_s,
"street" => "Southlands Drive",
"locality" => "Timsbury",
"town" => "Bath",
"postcode" => "BA2 0HB",
"provenance"=> {
"activity"=> {
"executed_at"=>"2015-01-30T17:57:51+00:00",
"processing_scripts"=>"https://github.com/OpenAddressesUK/sorting_office",
"derived_from" => [
{
"type"=>"userInput",
"input"=>"10 Downing Street, London, SW1A 2AA",
"inputted_at"=>"2015-01-30T17:57:51+00:00",
"processing_script"=> "https://github.com/OpenAddressesUK/sorting_office/tree/0fff78c71a170e2264faef7962e19f99a645c1d0/lib/sorting_office/address.rb"
},
{
"type"=>"Source",
"urls"=>["http://alpha.openaddressesuk.org/postcodes/Uxm2vc"],
"downloaded_at"=>"2015-01-30T17:57:51+00:00",
"processing_script"=>"https://github.com/OpenAddressesUK/sorting_office/tree/0fff78c71a170e2264faef7962e19f99a645c1d0/lib/models/postcode.rb"
},
{
"type"=>"Source",
"urls"=>["http://alpha.openaddressesuk.org/towns/qyHZe2"],
"downloaded_at"=>"2015-01-30T17:57:51+00:00",
"processing_script"=>"https://github.com/OpenAddressesUK/sorting_office/tree/0fff78c71a170e2264faef7962e19f99a645c1d0/lib/models/town.rb"
},
{
"type"=>"Source",
"urls"=>["http://alpha.openaddressesuk.org/streets/Gq5142"],
"downloaded_at"=>"2015-01-30T17:57:51+00:00",
"processing_script"=>"https://github.com/OpenAddressesUK/sorting_office/tree/0fff78c71a170e2264faef7962e19f99a645c1d0/lib/models/street.rb"
}
]
}
}
}
# The Turbot specification simply requires us to output lines of JSON
puts JSON.dump(data)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment