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

[tor-commits] [ooni-probe/develop] Add inputProcessor to http_host



commit 57a300305cd569f444d641cf1b25237e1e4b9be9
Author: aagbsn <aagbsn@xxxxxxxx>
Date:   Fri May 3 14:28:25 2013 +0800

    Add inputProcessor to http_host
---
 nettests/manipulation/http_host.py |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/nettests/manipulation/http_host.py b/nettests/manipulation/http_host.py
index d95d836..3f1e0c6 100644
--- a/nettests/manipulation/http_host.py
+++ b/nettests/manipulation/http_host.py
@@ -139,3 +139,13 @@ class HTTPHost(httpt.HTTPTest):
             self.report['transparent_http_proxy'] = True
             self.check_for_censorship(body)
 
+    def inputProcessor(self, filename=None):
+        """
+        This inputProcessor extracts domain names from urls
+        """
+        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