Custom search URLs

atomic dryad shared this idea 10 years ago
Gathering feedback

It would be neat to be able to add customized search URLs; IE, "search wikipedia" would do: http://api.wikilocation.org&lat={LATITUDE}&lng={LONGITUDE}&range=20&limit=50&locale=en


Alot of stuff uses json with a similar structure, and decimal wgs coordinates, so parsing the return data could be done with simple rule definitions, the actual entry array name specified under 'entries', and entry variables specified by {varname}. If something just spits out KML the data parsing rule would be simple. The search query itself could be more complex with text input or a dropdown list. I suppose this could be done in an XML file but I'll use a simple format for examples. For wikilocation:


data: json

entries: articles

latitude: {lat}

longitude: {lng}

title: {title}

desc: '<a href="{url}">{type}</a>'


Other examples:

"search home poi database": http://i.wrote.my/own.geonames.cgi?&lat={LATITUDE}&lng={LONGITUDE}&range=100km&amt=1024&namefilter={INPUT}&catfilter={LIST:spng|mt|etc|maybe|define|another|way}&format=kml

data: kml


This would add panoramio support as is:

"nearby panoramio": http://www.panoramio.com/map/get_panoramas.php?from=0&to=100&minx={MINLATITUDE}&miny={MINLONGITUDE}&maxx={MAXLATITUDE}&maxy={MAXLONGITUDE}&set=public&mapfilter=true

return: json

entries: photos

latitude={latitude}

longitude={longitude}

iconurl="http://mw2.google.com/mw-panoramio/photos/mini_square/{photo_id}.jpg"

title="{photo_title}"

desc='<a href="{photo_url}"><img src="{photo_file_url}"></a>'


Even without the added complexity of defining parsing rules, just a way to add multiple custom search urls for 'wikilocation json' (perhaps with kml output too) would be great. I've already released a serverside script that returns data in the format expected by wikipedia search, however I'm having to do DNS trickery and use the rather limited 'locale' dropdown to specify specific search types: http://forum.locusmap.eu/index.php?topic=3805.0

Locus itself seems to handle alot of return data for wikipedia search, the following is a 75km radius geonames query on a local db, based on location, limited to 1024 pois: gBbtUQb

Leave a Comment
 
Attach a file