[openstreetmap/openstreetmap-website] Add openplaques:id support and refactor the formatters (#2621)
mmd
notifications at github.com
Mon May 11 17:49:46 UTC 2020
@mmd-osm commented on this pull request.
> + end
+
+ if res.code == "200"
+ JSON.parse(res.body)["results"]["bindings"]
+ else
+ puts "HTTP code for #{url} is #{res.code}"
+ exit 1
+ end
+end
+
+filecontent = results.flatten({}) do |memo, result|
+ memo[result["OSM_key"]["value"].slice("Key:".size...)] = result["formatter_URL"]["value"]
+ memo
+end.to_yaml
+
+File.write(ARGV[0], filecontent)
Can you sort the results by key before generating the file? This way it's easier to merge changes later on.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2621#pullrequestreview-409394900
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200511/a71fc45d/attachment-0001.htm>
More information about the rails-dev
mailing list