def render_xmpp(self, hits, title): """ renders the result for xmpp responses """ result = title + "\n" if hits: for row in hits: result += "(%s) %s : %s\n" % (format_pub_date(row["pubDate"], "%Y/%m/%d"), row["title"], row["link"]) else: result += "No hits found!" return strip_tags(result)
def render_wave(self, hits, title): """ renders the result for wave responses """ result = " <br/><br/><b>%s</b><br/>" % xmlify(title) if hits: for row in hits: title = xmlify(row["title"]) result += '<a href="%s">%s (%s)</a><br/><br/>' % ( xmlify(row["link"]), title, format_pub_date(row["pubDate"], "%Y/%m/%d"), ) else: result += "No hits found!" return result