]> git.mxchange.org Git - friendica-addons.git/blobdiff - geonames/geonames.php
Restructure Cache to follow new paradigm
[friendica-addons.git] / geonames / geonames.php
index e6962d764efff4b52896fed5e4c6c7e8dfb701b0..8ea183db0d3cea238226894bd460343fa259aec0 100644 (file)
@@ -12,7 +12,6 @@ use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
 use Friendica\DI;
 use Friendica\Util\ConfigFileLoader;
-use Friendica\Util\Network;
 use Friendica\Util\XML;
 
 function geonames_install()
@@ -47,7 +46,7 @@ function geonames_post_hook(App $a, array &$item)
         *      - The profile owner must have allowed our addon
         */
 
-       Logger::log('geonames invoked');
+       Logger::notice('geonames invoked');
 
        if (!local_user()) {   /* non-zero if this is a logged in user of this system */
                return;
@@ -78,7 +77,7 @@ function geonames_post_hook(App $a, array &$item)
 
        /* OK, we're allowed to do our stuff. */
 
-       $s = Network::fetchUrl('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
+       $s = DI::httpClient()->fetch('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
 
        if (!$s) {
                return;
@@ -108,8 +107,6 @@ function geonames_addon_settings_post(App $a, array $post)
        }
 
        DI::pConfig()->set(local_user(), 'geonames', 'enable', intval($_POST['geonames-enable']));
-
-       info(DI::l10n()->t('Geonames settings updated.'));
 }
 
 /**