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

[tor-commits] [ooni-probe/master] Add inputProcessor that can handle urls, e.g. alexa-top-1m



commit eb40c95c7fdf114622ee0919144fca50e64d003e
Author: aagbsn <aagbsn@xxxxxxxx>
Date:   Sun Dec 2 16:36:53 2012 +0000

    Add inputProcessor that can handle urls, e.g. alexa-top-1m
---
 nettests/blocking/dnstamper.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/nettests/blocking/dnstamper.py b/nettests/blocking/dnstamper.py
index 6185e1b..b9dfc1b 100644
--- a/nettests/blocking/dnstamper.py
+++ b/nettests/blocking/dnstamper.py
@@ -151,3 +151,16 @@ class DNSTamperTest(dnst.DNSTest):
                     lookup_details()
                     log.msg("tampering: true")
                     self.report['tampering'][test_resolver] = True
+
+    def inputProcessor(self, filename=None):
+        """
+        This inputProcessor extracts domain names from urls
+        """
+        log.debug("Running dnstamper default processor")
+        if filename:
+            fp = open(filename)
+            for x in fp.readlines():
+                yield x.strip().split('//')[-1].split('/')[0]
+            fp.close()
+        else:
+            pass



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