4
RSS interface for Gwibber
5
SegPhault (Ryan Paul) - 11/08/2008
9
import urllib2, feedparser, can, support
26
feedparser._HTMLSanitizer.acceptable_elements = []
29
def __init__(self, client, data):
31
self.account = client.account
32
self.protocol = client.account["protocol"]
34
self.sender = data.get("author", "")
35
self.sender_nick = self.sender
36
self.sender_id = self.sender
38
if hasattr(data, "summary"):
39
self.text = data.summary
40
elif hasattr(data, "content"):
41
if hasattr(data.content, "value"):
42
self.text = data.content.value
46
self.time = support.parse_time(data.updated)
47
self.bgcolor = "message_color"
49
self.profile_url = "" # feed.author_detail.href
50
self.title = "%s <br /> <small>By %s</small>" % (data.title, self.sender)
52
if len(self.text) > 300:
53
self.html_string = "%s..." % self.text[:300]
54
else: self.html_string = self.text
57
def __init__(self, acct):
61
f = feedparser.parse(self.account["feed_url"])
63
for data in f.entries:
64
yield Message(self, data)