diff -up gwibber-2.91.92/gwibber/microblog/plugins/gowalla/__init__.py.gowalla-kitchen gwibber-2.91.92/gwibber/microblog/plugins/gowalla/__init__.py --- gwibber-2.91.92/gwibber/microblog/plugins/gowalla/__init__.py.gowalla-kitchen 2011-03-25 13:43:11.123113004 -0400 +++ gwibber-2.91.92/gwibber/microblog/plugins/gowalla/__init__.py 2011-03-25 13:47:05.879113003 -0400 @@ -26,6 +26,7 @@ from gwibber.microblog import network, u from gwibber.microblog.util import log, resources import json, htmllib, re from gettext import lgettext as _ +from kitchen.text.converters import to_unicode log.logger.name = "Gowalla" PROTOCOL_INFO = { @@ -60,46 +61,46 @@ class Client: def _message(self, data): m = {}; - m["mid"] = str(data["user"]["first_name"]) + str(data["user"]["last_name"]) - m["service"] = "gowalla" + m["mid"] = to_unicode(str(data["user"]["first_name"]) + str(data["user"]["last_name"])) + m["service"] = u"gowalla" m["account"] = self.account["id"] m["time"] = util.parsetime(data["created_at"]) - messagetext = "" - text = "" + messagetext = u"" + text = u"" if data.has_key("spot"): if data.has_key("message"): messagetext += data["message"] + "<br/><br/>" text += data["message"] + "\n" - m["url"] = "http://gowalla.com%s" % data["spot"]["url"] - img = "<table><tr><td><img src='%s'/></td><td>" % data["spot"]["image_url"] - messagetext += img + "Checked in at <a href='" + m["url"] + "'>" + data["spot"]["name"] + "</a>" - text += "Checked in at " + data["spot"]["name"] + m["url"] = to_unicode("http://gowalla.com%s" % data["spot"]["url"]) + img = to_unicode("<table><tr><td><img src='%s'/></td><td>" % data["spot"]["image_url"]) + messagetext += img + "Checked in at <a href='" + m["url"] + "'>" + to_unicode(data["spot"]["name"]) + "</a>" + text += u"Checked in at " + to_unicode(data["spot"]["name"]) else: if data.has_key("message"): - messagetext += data["message"] + "<br/><br/>" - text += data["message"] + "\n" + messagetext += to_unicode(data["message"]) + u"<br/><br/>" + text += to_unicode(data["message"]) + u"\n" else: - text= "Checked in off the grid" - messagetext= "<table><tr><td><img src='http://gowalla.com/favicon.ico'/></td><td>Checked in off the grid" + text= u"Checked in off the grid" + messagetext= u"<table><tr><td><img src='http://gowalla.com/favicon.ico'/></td><td>Checked in off the grid" m["text"] = text - m["content"] = messagetext + "</td></tr></table>" - m["html"] = messagetext + "</td></tr></table>" + m["content"] = messagetext + u"</td></tr></table>" + m["html"] = messagetext + u"</td></tr></table>" m["sender"] = {} - m["sender"]["image"] = data["user"]["image_url"] - m["sender"]["url"] = "http://gowalla.com%s" % data["user"]["url"] - fullname = "" + m["sender"]["image"] = to_unicode(data["user"]["image_url"]) + m["sender"]["url"] = to_unicode("http://gowalla.com%s" % data["user"]["url"]) + fullname = u"" if data["user"].has_key("first_name"): - fullname += data["user"]["first_name"] + " " + fullname += to_unicode(data["user"]["first_name"]) + u" " if data["user"].has_key("last_name"): - fullname += data["user"]["last_name"] + fullname += to_unicode(data["user"]["last_name"]) m["sender"]["name"] = fullname m["sender"]["nick"] = fullname - m["source"] = "<a href='http://gowalla.com/'>Gowalla</a>" + m["source"] = u"<a href='http://gowalla.com/'>Gowalla</a>" return m