title: Python geoip find country using json
body: <pre><code>from urllib2 import urlopen
  from contextlib import closing
  import json
  import time
  import os
  
  while True:
      url = 'http://freegeoip.net/json/'
      try:
          with closing(urlopen(url)) as response:
              location = json.loads(response.read())
              location_city = location['city']
              location_state = location['region_name']
              location_country = location['country_name']
              #print(location_country)
              if location_country == "Germany":
                  print("You are now surfing from: " + location_country)
                  os.system(r'firefox /home/user/Documents/alert.html')
                      except:
          print("Could not find location, searching again...")
      time.sleep(1)   
  </code></pre>
  
  <p>Its doesn't reply any country can I get help to solve the problem?</p>