@@ -15,12 +15,15 @@ class TelizeDriver extends AbstractGeoIPDriver
1515 */
1616 public function get ($ ip )
1717 {
18+
1819 try {
19- $ data = json_decode ( $ this ->guzzle -> get ($ this ->getUrl ($ ip ))->getBody (), true );
20+ $ data = $ this -> requester -> headers ([ ' X-Mashape-Key ' => array_get ( $ this ->config , ' key ' ), ' Accept ' => ' application/json ' ])-> url ($ this ->getUrl ($ ip ))->get ()-> json ( );
2021 } catch (RequestException $ e ) {
2122 return [];
2223 }
2324
25+ dd ($ data );
26+
2427 return [
2528 'city ' => array_get ($ data , 'city ' ),
2629 'country ' => array_get ($ data , 'country ' ),
@@ -31,7 +34,7 @@ public function get($ip)
3134 'regionCode ' => array_get ($ data , 'region_code ' ),
3235 'timezone ' => array_get ($ data , 'timezone ' ),
3336 'postalCode ' => array_get ($ data , 'postal_code ' ),
34- 'isp ' => array_get ($ data , 'isp ' ),
37+ 'isp ' => array_get ($ data , 'organization ' ), // unsure what to return here; previously it was 'isp', but that does not exist anylonger.
3538 ];
3639 }
3740
@@ -49,7 +52,7 @@ protected function getUrl($ip)
4952 $ protocol = 'https: ' ;
5053 }
5154
52- $ baseUrl = $ protocol .'//www. telize.com/geoip/ ' ;
55+ $ baseUrl = $ protocol .'//telize-v1.p.mashape .com/geoip/ ' ;
5356
5457 return $ baseUrl .$ ip ;
5558 }
0 commit comments