From 2576a4d37cbe88b115c6d69718b2eb1500f80553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaussoin=20Timoth=C3=A9e?= Date: Fri, 11 Jul 2014 21:23:59 +0200 Subject: [PATCH] - Set deliver_payload to false - Add a little timer between the submissions --- atomtopubsub.py | 2 ++ publishx.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/atomtopubsub.py b/atomtopubsub.py index 3cbcef5..9c39806 100755 --- a/atomtopubsub.py +++ b/atomtopubsub.py @@ -49,6 +49,8 @@ def parse(): print colored('++ new entry %s' % entry.title, 'green') else: print colored('++ update entry %s' % entry.title, 'yellow') + + time.sleep(2) xmpp.publish(feed['server'], key, entry) # And we update the last updated date for the feed diff --git a/publishx.py b/publishx.py index c53ec99..31ce886 100644 --- a/publishx.py +++ b/publishx.py @@ -60,6 +60,9 @@ class publishx(sleekxmpp.ClientXMPP): iq['pubsub']['configure']['form'].addField('pubsub#type', ftype = 'text-single', value = NS_ATOM) + iq['pubsub']['configure']['form'].addField('pubsub#deliver_payload', + ftype = 'boolean', + value = 0) iq['pubsub']['configure']['form'].addField('pubsub#description', ftype = 'text-single', value = description) @@ -77,7 +80,6 @@ class publishx(sleekxmpp.ClientXMPP): item = pubsub.Item() item['id'] = entry.id - #payload = ET.Item() ent = ET.Element("entry") ent.set('xmlns', NS_ATOM) @@ -91,7 +93,6 @@ class publishx(sleekxmpp.ClientXMPP): content = ET.SubElement(ent, "content") content.set('type', entry.content[0].type) - #document, errors = tidy_document() content.text = entry.content[0].value if(hasattr(entry, 'links')):