<commit_before><?php
/**
 * @package     Mautic
 * @copyright   2015 Mautic Contributors. All rights reserved.
 * @author      Mautic
 * @link        http://mautic.org
 * @license     GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */

namespace Mautic\CoreBundle\IpLookup;


class IP2LocationAPILookup extends AbstractRemoteDataLookup
{
    /**
     * @return string
     */
    public function getAttribution()
    {
        return '<a href="http://IP2Location.com/" target="_blank">IP2Location </a> web service WS9 Package only.';
    }

    /**
     * @return string
     */
    protected function getUrl()
    {
        return "api.ip2location.com/?ip={$this->ip}&key={$this->auth}&package=WS9&format=json";
    }
	
	

    /**
     * @param $response
     */
    protected function parseResponse($response)
    {
	  try {
		$record = json_decode($response);
		if(isset($record->country_name)){
			$this->country = $record->country_name;
			$this->region = $record->region_name;
			$this->city = $record->city_name;
			$this->latitude  = $record->latitude;
			$this->longitude = $record->longitude;
			//$this->timezone  = $record->location->timeZone;
			$this->zipcode   = $records->zip_code;
		}
	  }catch (\Exception $exception) {
            if ($this->logger) {
                $this->logger->warn("IP LOOKUP: " . $exception->getMessage());
            }
      }
    }
}<commit_msg>Changed records to record and fixed formating<commit_after><?php
/**
 * @package     Mautic
 * @copyright   2015 Mautic Contributors. All rights reserved.
 * @author      Mautic
 * @link        http://mautic.org
 * @license     GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */

namespace Mautic\CoreBundle\IpLookup;


class IP2LocationAPILookup extends AbstractRemoteDataLookup
{
    /**
     * @return string
     */
    public function getAttribution()
    {
        return '<a href="http://IP2Location.com/" target="_blank">IP2Location </a> web service WS9 Package only.';
    }

    /**
     * @return string
     */
    protected function getUrl()
    {
        return "api.ip2location.com/?ip={$this->ip}&key={$this->auth}&package=WS9&format=json";
    }



    /**
     * @param $response
     */
    protected function parseResponse($response)
    {
        try {
            $record = json_decode($response);
            if(isset($record->country_name)){
                $this->country = $record->country_name;
                $this->region = $record->region_name;
                $this->city = $record->city_name;
                $this->latitude  = $record->latitude;
                $this->longitude = $record->longitude;
                //$this->timezone  = $record->location->timeZone;
                $this->zipcode   = $record->zip_code;
            }
        }catch (\Exception $exception) {
            if ($this->logger) {
                $this->logger->warn("IP LOOKUP: " . $exception->getMessage());
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.15447154471544716, 'fraction_numerical': 0.008807588075880758, 'mean_word_length': 2.2237991266375547, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2010608', 'n_tokens_mistral': 950, 'n_tokens_neox': 902, 'n_words': 158}