Automated edits/rodrigodiez/Add missing URL scheme to pub websites in UK
Jump to navigation
Jump to search
Problem
At the moment of writing this proposal, in the UK there are 127 amenity=pub nodes with a website=* lacking an URL Scheme (http(s)://).
Consumers expect to find a valid URL in website=*, including a scheme, as described on Key:website but, in this case, the content of the tag is not a valid URL. Consumers may face all sort of problems when trying to use website=* as a URL.
Examples:
- https://www.openstreetmap.org/node/20922155
- https://www.openstreetmap.org/node/20940218
- https://www.openstreetmap.org/node/21648679
Proposal
- To write a script that, for each of these nodes, behaves as follows
- Find an appropriate scheme
- Append https:// to the original website=* (as described on Key:website#Privacy_and_security https is prefered)
- Load the resulting URL and follow a maximum of 3 redirects until a 2xx HTTP response is found
- If https:// is a valid schema for the website, stop here
- Append http:// to the original website=*
- Load the resulting URL and follow a maximum of 3 redirects until a 2xx HTTP response is found
- If a valid scheme is found, amend node's website=* with SCHEME://PREVIOUS_WEBSITE
- If no valid scheme is found, do nothing
- Find an appropriate scheme
- To discuss the proposal with Talk-GB until a consensus is reached
- To keep this page updated with the results of the discussion
- If the experience is satisfactory, to raise a more global discussion with the OSM community to detect and fix schemaless website=* tags in a more automated way and potentially a greater scope.
Scope
One-off script, targetting nodes in UK with amenity=pub and website=* not starting with http:// nor https://
[out:json]; area["ISO3166-1"="GB"][admin_level=2]; node (area)[amenity=pub] out;
Contact
Rodrigo Diez Villamuera, rodrigo@rodrigodiez.io