]> git.mxchange.org Git - friendica-addons.git/blobdiff - geonames/geonames.php
Merge pull request #518 from annando/item-isolation
[friendica-addons.git] / geonames / geonames.php
index eb5a0c87234fc194a3410d5fcd0c61be76fda9bc..79e268e6eeddb2d948953fa2b41d32e97636d6ca 100644 (file)
@@ -23,6 +23,8 @@ use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Util\Network;
+use Friendica\Util\XML;
 
 function geonames_install() {
 
@@ -111,12 +113,12 @@ function geonames_post_hook($a, &$item) {
         *
         */
 
-       $s = fetch_url('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
+       $s = Network::fetchUrl('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
 
        if(! $s)
                return;
 
-       $xml = parse_xml_string($s);
+       $xml = XML::parseString($s);
 
        if($xml->geoname->name && $xml->geoname->countryName)
                $item['location'] = $xml->geoname->name . ', ' . $xml->geoname->countryName;