Software /
code /
prosody-modules
Diff
mod_pubsub_twitter/mod_pubsub_twitter.lua @ 978:c8f4502c764f
mod_pubsub_twitter: Wrap published item in an <item> element for pubsub
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 08 Apr 2013 14:45:00 +0100 |
parent | 945:dbcbcec37d24 |
child | 1343:7dbde05b48a9 |
line wrap: on
line diff
--- a/mod_pubsub_twitter/mod_pubsub_twitter.lua Mon Apr 08 01:01:11 2013 +0200 +++ b/mod_pubsub_twitter/mod_pubsub_twitter.lua Mon Apr 08 14:45:00 2013 +0100 @@ -45,15 +45,16 @@ local timestamp = ("%s-%s-%sT%sZ"):format(timestamp_year, month_number[timestamp_month], timestamp_date, timestamp_time); - local item = st.stanza("entry", { xmlns = xmlns_atom }) - :tag("id"):text(id):up() - :tag("author") - :tag("name"):text(result.from_user_name.." (@"..result.from_user..")"):up() - :tag("uri"):text("http://twitter.com/"..result.from_user):up() - :up() - :tag("published"):text(timestamp):up() - :tag("title"):text(result.text):up() - :tag("link", { rel = "alternate" , href = "https://twitter.com/"..result.from_user.."/status/"..id}):up(); + local item = st.stanza("item", { xmlns = "http://jabber.org/protocol/pubsub", id = id }) + :tag("entry", { xmlns = xmlns_atom }) + :tag("id"):text(id):up() + :tag("author") + :tag("name"):text(result.from_user_name.." (@"..result.from_user..")"):up() + :tag("uri"):text("http://twitter.com/"..result.from_user):up() + :up() + :tag("published"):text(timestamp):up() + :tag("title"):text(result.text):up() + :tag("link", { rel = "alternate" , href = "https://twitter.com/"..result.from_user.."/status/"..id}):up(); module:log("debug", "Publishing Twitter result: %s", tostring(item));