diff options
Diffstat (limited to 'unfoggedbot.py')
-rw-r--r-- | unfoggedbot.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/unfoggedbot.py b/unfoggedbot.py index 4c943ba..19362da 100644 --- a/unfoggedbot.py +++ b/unfoggedbot.py @@ -1,12 +1,12 @@ #! /usr/bin/python -#from twisted.words.protocols import oscar -import oscar +from twisted.words.protocols import oscar +#import oscar ## local copy taken from the py-aimt project. ## some API differences, but it automagically does rate-limiting stuff. from twisted.internet import protocol, reactor from twisted.enterprise.adbapi import ConnectionPool from twisted.python import log -import re, feedparser, socket, sets, os +import re, socket, sets, os #socket.setdefaulttimeout(60) @@ -21,7 +21,7 @@ GETSUBSCRIBERS = "SELECT screen_name FROM subscriptions WHERE thread_url = ?" INSERTCOMMENTS = "INSERT OR IGNORE INTO rss_items (link, processed, thread_url, author, content, title) VALUES (?, ?, ?, ?, ?, ?)" INSERTPOSTS = "INSERT OR IGNORE INTO posts (post_url, title, processed) VALUES (?, ?, ?)" -db = ConnectionPool("pysqlite2.dbapi2", DB) +db = None permalink = re.compile("http://(www\.)?unfogged\.com/archives/week_...._.._..\.html#(\d+)") commentlink = re.compile("http://(www\.)?unfogged\.com/archives/comments_(\d+).html") @@ -208,8 +208,6 @@ class ReconnectingOSCARLoginFactory(protocol.ReconnectingClientFactory): def getrss(): ##on the assumption that this can be done w/o using too much time, ##I have taken this out of a separate thread. - comments = feedparser.parse("/home/unfogged/unfogged/html/bridgeplate.rdf") - posts = feedparser.parse("/home/unfogged/unfogged/html/index.xml") updaterss(comments, posts) reactor.callLater(15, getrss) @@ -230,7 +228,7 @@ def updaterss(comments, posts): if __name__ == '__main__': - execfile(RC) # values of "sn" and "pass_" + sn,pass_="aa","bb" import sys sys.stderr = sys.stdout = open("ubot.log", "a+") log.startLogging(sys.stdout) |