[openstreetmap/openstreetmap-website] Add openplaques:id support and refactor the formatters (#2621)

François de Metz notifications at github.com
Mon May 11 17:56:45 UTC 2020


@francois2metz 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)

Done.

-- 
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#discussion_r423217513
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20200511/e0310acd/attachment.htm>


More information about the rails-dev mailing list