[twitter-dev] Re: Oauth API not updating statuses consistently

2009-11-03 Thread Enlai Chu

Thanks for the prompt response.

Yes, the request is timing out with no response right now. We've seen 
sporadic behavior like this the last few days and we've built in retry 
mechanisms so messages aren't getting lost. As far as I understand, 
posts of statuses aren't being rate limited so this shouldn't be a 
problem. Individual account rate limits aren't being hit (we tested one 
account and when the rate per day was hit, we were getting actual error 
responses regarding this limit).

However, the retry mechanisms are failing because the post succeeds, yet 
the text being posted is not the one we're posting. Instead, we get the 
post from the previous successful message about 2 hours ago.

Sent for posting:

Hv 2 catch up on the scriptures: He has delivered us from the power of darkness 
and conveyed is into the kingdom of the Son of His love. COLOSSIANS 1:13

The response shows the succesful post, but the text is the previous post 
from 20 minutes ago:

texthi/text

Entire response is below.

Thanks,
Enlai

Response:
?xml version=1.0 encoding=UTF-8?
status
  created_atTue Nov 03 05:39:55 + 2009/created_at
  id5384817467/id
  texthi/text
  sourcelt;a href=quot;http://www.mogotxt.comquot; 
rel=quot;nofollowquot;gt;MogoTXTlt;/agt;/source
  truncatedfalse/truncated
  in_reply_to_status_id/in_reply_to_status_id
  in_reply_to_user_id/in_reply_to_user_id
  favoritedfalse/favorited
  in_reply_to_screen_name/in_reply_to_screen_name
  user
id48108108/id
nameEnlai Test/name
screen_nameenlaitest/screen_name
location/location
description/description

profile_image_urlhttp://a3.twimg.com/profile_images/277692677/enlai_elf_normal.jpg/profile_image_url
url/url
protectedfalse/protected
followers_count143/followers_count
profile_background_color9ae4e8/profile_background_color
profile_text_color00/profile_text_color
profile_link_colorff/profile_link_color
profile_sidebar_fill_colore0ff92/profile_sidebar_fill_color
profile_sidebar_border_color87bc44/profile_sidebar_border_color
friends_count393/friends_count
created_atWed Jun 17 20:43:25 + 2009/created_at
favourites_count0/favourites_count
utc_offset/utc_offset
time_zone/time_zone

profile_background_image_urlhttp://s.twimg.com/a/1257210731/images/themes/theme1/bg.png/profile_background_image_url
profile_background_tilefalse/profile_background_tile
statuses_count58/statuses_count
notificationsfalse/notifications
geo_enabledfalse/geo_enabled
verifiedfalse/verified
followingfalse/following
  /user
  geo/
/status



Enlai

Raffi Krikorian wrote:
 Hi Enlai.

 Can you provide more information, please?

 If you experience times that there is no response, do you mean that
 the request is timing out?

 As for getting a successful response, yet the status not updating
 could be caused by sending tweets with the same text as a tweet you
 sent recently.

 Either way, I don't know which of these, if any, are afflicting you.
 Can you provide more information as to what precisely you are issuing
 to the API, and what precisely is it responding with?

 Thanks!



 On Nov 2, 2009, at 9:45 PM, Enlai en...@3jam.com wrote:

   
 Sorry if this is a dumb question but I can't find an answer online.
 This is happening right now so I thought I'd see if something is up
 with the API.

 Sometimes, I get no response from the status update post and other
 times, I get a response with a successful post result. However, the
 text in the post shows the previous successful post rather than the
 one I just posted.

 What does this mean? Has some rate been tripped?

 Thanks
 Enlai
 


[twitter-dev] Re: Oauth API not updating statuses consistently

2009-11-03 Thread Enlai Chu

Dave, thanks a bunch. You called it. Looks like the update was greater 
than 140 characters and the API was failing silently.

Thanks!

Enlai

Dave Sherohman wrote:
 On Mon, Nov 02, 2009 at 09:38:48PM -0800, Enlai wrote:
   
 Sorry if this is a dumb question but I can't find an answer online.
 This is happening right now so I thought I'd see if something is up
 with the API.

 Sometimes, I get no response from the status update post and other
 times, I get a response with a successful post result. However, the
 text in the post shows the previous successful post rather than the
 one I just posted.

 What does this mean? Has some rate been tripped?
 

 This has been noted by a few of us since mid-October.  Twitter changed
 the API behaviour such that a status update will fail silently and
 return the user's most recent prior status in two (known) cases:

 - If the text of the update exceeds 140 characters.  (This is a change
   from the documented behaviour of truncating the text to 140
   characters.)

 - If the text of the update is a duplicate of *any* previous status
   update within an as-yet-unknown time period.  I know from my own
   experience that the time period is at least an hour and I suspect that
   it it much longer, perhaps even unlimited.  (This is a change from the
   documented behaviour of only rejecting duplicates when consecutive.)

 There has been a comment made here on the list to the effect that
 Twitter intends to respond with an error code in these cases rather than
 failing silently, but no indication was given regarding an expected
 timeframe.

 Until Twitter does get around to telling us when updates have been
 rejected, two basic approaches have been suggested for detecting these
 silent failures:

 - Store the highest status ID which has been seen by your application.
   When you submit an update, check the ID of the returned status.  If
   the returned ID is less than the stored ID, you know the update was
   rejected and an old status was returned.

 - Compare the text of the sent status to the text of the returned status
   to see if they match.

 I prefer the ID-based method, as the text-based method is subject to
 both false positives (if Twitter applies bit.ly shortening, you'll think
 it failed unless you remember to ignore URLs when comparing the text)
 and false negatives (if the update is a duplicate of the user's most-
 recent status, the text will match even though the update failed), but
 YMMV.