[EP-tech] Unreliable tweeting

Cox, Alan G. agc at nerc.ac.uk
Wed Jul 17 09:32:07 BST 2013


If you’re using the recipe at http://wiki.eprints.org/w/Twitter to tweet whenever a new item is deposited, do you find it reliable?
I’m seeing a success rate of < 50% and don’t understand why.
The failures are reported as failures in authentication – even though the OAuth credentials are the same as in the successful tweets. (See
Wireshark captures below.)
I’m intimate neither with OAuth nor the Twitter API so have just followed the recipe above (changing API version to 1.1). Is there anything else I should know, or be looking at?
I’m using LWP-Authen-OAuth-1.02.
Thanks,
            Alan.
Alan Cox | Information, Systems & Technology | Natural Environment Research Council
Polaris House, North Star Avenue, Swindon, SN2 1EU, UK
+44 (0)1793 411963 | agc at nerc.ac.uk<mailto:agc at nerc.ac.uk>

A failing interaction:
Request:
POST /1.1/statuses/update.json HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Authorization: OAuth oauth_nonce="97985dac8caf0f62bef442099bc63476",oauth_timestamp="1373991134",oauth_version="1.0",oauth_consumer_key="HhWlbCIyWHggL9392ugnw",oauth_token="16218848-EoKnZSnlVJqw8TUbNsop2psmXdB4KXItPovG9lTqF",oauth_signature_method="HMAC-SHA1",oauth_signature="S9jyoWZSLhEoc74j3taPjhYaKOs%3D"
Host: api.twitter.com
User-Agent: libwww-perl/6.03
Content-Length: 141
Content-Type: application/x-www-form-urlencoded
status=Among+population+differentiation+at+nuclear+genes+in+native+Scots+pine+(Pinus+sylvestris+L.)+in+Scotland+-+http%3A%2F%2Fis.gd%2FSPR2gl

Response:
HTTP/1.1 401 Unauthorized
content-length: 63
content-type: application/json; charset=utf-8
date: Tue, 16 Jul 2013 16:12:14 UTC
server: tfe
set-cookie: guest_id=v1%3A137399113479004887; Domain=.twitter.com; Path=/; Expires=Thu, 16-Jul-2015 16:12:14 UTC
{"errors":[{"message":"Could not authenticate you","code":32}]}

A successful interaction:
Request:
POST /1.1/statuses/update.json HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Authorization: OAuth oauth_nonce="a1646dd37fab3770fde2639dcca5a2c4",oauth_timestamp="1373991111",oauth_version="1.0",oauth_consumer_key="HhWlbCIyWHggL9392ugnw",oauth_token="16218848-EoKnZSnlVJqw8TUbNsop2psmXdB4KXItPovG9lTqF",oauth_signature_method="HMAC-SHA1",oauth_signature="q03pqOdrEROd5ujXwYYhJ%2BQNkXE%3D"
Host: api.twitter.com
User-Agent: libwww-perl/6.03
Content-Length: 129
Content-Type: application/x-www-form-urlencoded
status=Declining+incidence+of+multi-trunking+over+time+in+a+Scottish+plantation+of+Picea+sitchensis+-+http%3A%2F%2Fis.gd%2FkKks8I

Response:
HTTP/1.1 200 OK
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
content-length: 2088
content-type: application/json; charset=utf-8
date: Tue, 16 Jul 2013 16:11:51 GMT
etag: "9fd608a1954287eed92c00a020a5c0a1"
expires: Tue, 31 Mar 1981 05:00:00 GMT
last-modified: Tue, 16 Jul 2013 16:11:51 GMT
pragma: no-cache
server: tfe
set-cookie: dnt=; domain=.twitter.com; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
set-cookie: lang=en; path=/
set-cookie: lang=en; path=/
set-cookie: lang=en; path=/
set-cookie: twid=******************; domain=.twitter.com; path=/; HttpOnly
set-cookie: guest_id=***************; Domain=.twitter.com; Path=/; Expires=Thu, 16-Jul-2015 16:11:51 UTC
status: 200 OK
vary: Accept-Encoding
x-access-level: read-write
x-frame-options: SAMEORIGIN
x-mid: *********************
x-runtime: 0.60101
x-transaction: *******************
x-transaction-mask: ***************************
<JSON body excised>


________________________________
This message (and any attachments) is for the recipient only. NERC is subject to the Freedom of Information Act 2000 and the contents of this email and any reply you make may be disclosed by NERC unless it is exempt from release under the Act. Any material supplied to NERC may be stored in an electronic records management system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20130717/9d617c13/attachment-0001.html 


More information about the Eprints-tech mailing list