[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Remove code for duckduckgo geoip lookup service.



commit 332a1879a3f6dfc4be2b09f9f779fe8a9d2fa2dc
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date:   Wed Dec 7 12:46:49 2016 +0000

    Remove code for duckduckgo geoip lookup service.
    
    It is not reliable.
    Closes https://github.com/TheTorProject/ooni-probe/issues/670
---
 ooni/geoip.py | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/ooni/geoip.py b/ooni/geoip.py
index c765015..eda814e 100644
--- a/ooni/geoip.py
+++ b/ooni/geoip.py
@@ -144,15 +144,6 @@ class UbuntuGeoIP(HTTPGeoIPLookupper):
         probe_ip = m.group(1)
         return probe_ip
 
-class DuckDuckGoGeoIP(HTTPGeoIPLookupper):
-    url = "https://api.duckduckgo.com/?q=ip&format=json";
-
-    def parseResponse(self, response_body):
-        j = json.loads(response_body)
-        regexp = "Your IP address is (.*) in "
-        probe_ip = re.search(regexp, j['Answer']).group(1)
-        return probe_ip
-
 INITIAL = 0
 IN_PROGRESS = 1
 
@@ -165,10 +156,6 @@ class ProbeIP(object):
     def __init__(self):
         self.geoIPServices = {
             'ubuntu': UbuntuGeoIP
-            # We are disabling this because it sometimes creates parsing
-            # errors.
-            # See: https://github.com/TheTorProject/ooni-probe/issues/670
-            # 'duckduckgo': DuckDuckGoGeoIP
         }
         self.geodata = {
             'asn': 'AS0',



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits