]> andersk Git - jira-zephyrbot.git/commitdiff
Initial commit.
authorEdward Z. Yang <edwardzyang@thewritingpot.com>
Wed, 11 Feb 2009 07:02:34 +0000 (02:02 -0500)
committerEdward Z. Yang <edwardzyang@thewritingpot.com>
Wed, 11 Feb 2009 07:02:34 +0000 (02:02 -0500)
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
.gitignore [new file with mode: 0644]
jirabot.py [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..353caeb
--- /dev/null
@@ -0,0 +1,2 @@
+cert.pem
+*.cookie
diff --git a/jirabot.py b/jirabot.py
new file mode 100644 (file)
index 0000000..bf05517
--- /dev/null
@@ -0,0 +1,49 @@
+import zephyr
+import feedparser
+import pycurl
+
+"""Screen scrapes jira.mit.edu. Supposedly. Doesn't actually work yet.
+
+You need to have a personal certificate named cert.pem in this
+directory to run this script. You also need the abovementioned scripts.
+The zephyr bindings can be gotten from ebroder's GitHub repository
+located: http://github.com/ebroder/python-zephyr/tree/master
+
+SSL server CA authentication is disabled because we don't know how to
+make curl stop complaining.
+
+Current difficulty is we are causing a NullPointer exception on
+(we think) touchstone's servers."""
+
+class Browser(object):
+    def __init__(self, **kwargs):
+        self.opts = kwargs
+        self.lastResult = None
+    def _callback(self, buf):
+        self.lastResult += buf
+    def get(self, url):
+        c = pycurl.Curl()
+        c.setopt(c.URL, url)
+        c.setopt(c.WRITEFUNCTION, self._callback)
+        for k,v in self.opts.items():
+            c.setopt(getattr(c, k), v)
+        self.lastResult = ''
+        c.perform()
+        return self.lastResult
+
+b = Browser(
+    SSLCERT = "cert.pem",
+    SSLKEY = "cert.pem",
+    SSL_VERIFYPEER = 0,
+    COOKIEJAR = "jirabot.cookie",
+    FOLLOWLOCATION = 1,
+)
+
+b.get("https://jira.mit.edu/jira/secure/Dashboard.jspa")
+print b.get("https://jira.mit.edu/jira/secure/mit_login.jsp?os_destination=/secure/Dashboard.jspa")
+
+#c.setopt(c.URL, "https://jira.mit.edu/jira/sr/jira.issueviews:searchrequest-rss/temp/SearchRequest.xml?&pid=10185&updated%3Aprevious=-1w&sorter/field=updated&sorter/order=DESC&tempMax=1000")
+
+#d = feedparser.parse(t.contents)
+#print d
+
This page took 0.048104 seconds and 5 git commands to generate.