summaryrefslogtreecommitdiff
path: root/plugins/GeonamesPlugin.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-10-29 15:07:26 -0400
committerEvan Prodromou <evan@status.net>2009-10-29 15:07:26 -0400
commit62ba14f5cf54235a0929d2ab06b62bad02ff7241 (patch)
tree9db8ba8709860403c4389d958fd4b8033dd5fc70 /plugins/GeonamesPlugin.php
parenta6ed4e5bf7e7c15bc649c91451bbe7b6aa1f0735 (diff)
make an URL for a geonames location
Diffstat (limited to 'plugins/GeonamesPlugin.php')
-rw-r--r--plugins/GeonamesPlugin.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/GeonamesPlugin.php b/plugins/GeonamesPlugin.php
index 745cd4126..80ef44cc9 100644
--- a/plugins/GeonamesPlugin.php
+++ b/plugins/GeonamesPlugin.php
@@ -278,4 +278,28 @@ class GeonamesPlugin extends Plugin
return true;
}
+
+ /**
+ * Human-readable name for a location
+ *
+ * Given a location, we try to retrieve a geonames.org URL.
+ *
+ * @param Location $location Location to get the url for
+ * @param string &$url Place to put the url
+ *
+ * @return boolean whether to continue
+ */
+
+ function onLocationUrl($location, &$url)
+ {
+ if ($location->location_ns != self::NAMESPACE) {
+ // It's not one of our IDs... keep processing
+ return true;
+ }
+
+ $url = 'http://www.geonames.org/' . $location->location_id;
+
+ // it's been filled, so don't process further.
+ return false;
+ }
}