[twitter-dev] retween_count field type

2011-02-05 Thread Toby M
Hello,

As far as I can tell in the documentation and the API announcement,
the retweet_count field is supposed to be an integer. However for
popular tweets the value is 100+ which is a string. I'm working
around this now by parsing an integer out of the field so 100+
becomes 100.

So, I think the documentation should be updated to mark the
retweet_count field as a string, or the API should be updated to
only return an integer. I'd prefer the latter, understanding that it
would only be an approximation.

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Re: My Tweets, Retweeted

2010-10-15 Thread Toby
Wow, just what I was looking for! :)

Do any of you know, if it's possible to fetch retweets of a user
without authorizing as him? Or are they so 'secret' that only the
retweeted user should see them? :)

- 2biazdk

On 15 Okt., 05:31, polomasta poloma...@gmail.com wrote:
 ah thanks! that should do the trick :-)

 On Oct 14, 5:03 pm, Taylor Singletary taylorsinglet...@twitter.com
 wrote:



  Take a look athttp://dev.twitter.com/doc/get/statuses/:id/retweeted_by

  Taylor

  On Thu, Oct 14, 2010 at 2:21 PM, polomasta poloma...@gmail.com wrote:
   In my application I would like to show My Tweets, Retweeted with the
   rest of the Mentions for a user. (similar to the way they show up in
   your mentions column in tweetdeck)

   So far I haven't been able to figure out how to do this.. these tweets
   don't show up via user/mentions.

   I'm able to retrieve user/retweets_of_me but in the JSON response
   there is no way to tell who in fact did the retweeting.

   Can anyone give me a suggestion as to how to solve/implement this?

   (It's a rails app and I'm using the twitter gem)

   Here is an example of the response I get when calling user/
   retweets_of_me ... I know for a fact his particular tweet has been
   retweeted twice by others

   = #Hashie::Mash contributors=nil coordinates=nil created_at=Thu Oct
   14 18:35:07 + 2010 favorited=false geo=nil id=27366026129
   in_reply_to_screen_name=nil in_reply_to_status_id=nil
   in_reply_to_user_id=nil place=nil retweet_count=0 retweeted=false
   source=a href=\http://twitter.com/tweetbutton\; rel=\nofollow
   \Tweet Button/a text=Startup Profile: Mobestream Media |
    launchDFWhttp://t.co/3bewuhq...@launchdfw; truncated=false
   user=#Hashie::Mash contributors_enabled=false created_at=Sat Mar 15
   01:26:52 + 2008 description=ExpatEntrepreneur.tv, Designer 
   Developer -- TweetSaver.com, IncaRentals.com, clkpic.com,
   launchDFW.com, FreshieApp.com, TweetAbout.com, Hire-Engineers.com
   favourites_count=39 follow_request_sent=nil followers_count=1813
   following=nil friends_count=1314 geo_enabled=true id=14150637
   lang=en listed_count=130 location=Lima, Perú name=Bradley Joyce
   notifications=nil profile_background_color=cc
   profile_background_image_url=http://a1.twimg.com/
   profile_background_images/98444516/blj_twitter.png
   profile_background_tile=true profile_image_url=http://a3.twimg.com/
   profile_images/421303551/bradley_normal.png
   profile_link_color=a15f3b profile_sidebar_border_color=FF
   profile_sidebar_fill_color=cc profile_text_color=507e94
   profile_use_background_image=true protected=false
   screen_name=bradleyjoyce show_all_inline_media=false
   statuses_count=3248 time_zone=Central Time (US  Canada) url=http://
   bradleyjoyce.me utc_offset=-21600 verified=false

   --
   Twitter developer documentation and resources:http://dev.twitter.com/doc
   API updates via Twitter:http://twitter.com/twitterapi
   Issues/Enhancements Tracker:
  http://code.google.com/p/twitter-api/issues/list
   Change your membership to this group:
  http://groups.google.com/group/twitter-development-talk

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Re: My Tweets, Retweeted

2010-10-15 Thread Toby
Hi Taylor.

Thanks for the reply!

However I'm looking for at retweets_of_user, instead of a
retweeted_by_user - if that makes sense.

I would like to fetch the retweeted tweets of a given user, not what
he has retweeted from others. :)

- 2biazdk

On 15 Okt., 16:23, Taylor Singletary taylorsinglet...@twitter.com
wrote:
 I think this is what you're looking for -- it's not documented on the portal
 yet and came as part of the #newtwitter upgrades:

 GET /1/statuses/retweeted_by_user.{format}
 Does not require authentication, unless the user is protected.
 Returns the 20 most recent retweets posted by the specified user. The
 user is specified using the user_id or screen_name parameters. This
 method is identical to statuses/retweeted_by_me except you can choose
 the user to view.

 Example: twurl /1/statuses/retweeted_by_user.json?screen_name=twitterapi

 Taylor





 On Fri, Oct 15, 2010 at 7:13 AM, Toby 2bia...@gmail.com wrote:

  Wow, just what I was looking for! :)

  Do any of you know, if it's possible to fetch retweets of a user
  without authorizing as him? Or are they so 'secret' that only the
  retweeted user should see them? :)

  - 2biazdk

  On 15 Okt., 05:31, polomasta poloma...@gmail.com wrote:
   ah thanks! that should do the trick :-)

   On Oct 14, 5:03 pm, Taylor Singletary taylorsinglet...@twitter.com
   wrote:

Take a look athttp://dev.twitter.com/doc/get/statuses/:id/retweeted_by

Taylor

On Thu, Oct 14, 2010 at 2:21 PM, polomasta poloma...@gmail.com
 wrote:
 In my application I would like to show My Tweets, Retweeted with
 the
 rest of the Mentions for a user. (similar to the way they show up in
 your mentions column in tweetdeck)

 So far I haven't been able to figure out how to do this.. these
 tweets
 don't show up via user/mentions.

 I'm able to retrieve user/retweets_of_me but in the JSON response
 there is no way to tell who in fact did the retweeting.

 Can anyone give me a suggestion as to how to solve/implement this?

 (It's a rails app and I'm using the twitter gem)

 Here is an example of the response I get when calling user/
 retweets_of_me ... I know for a fact his particular tweet has been
 retweeted twice by others

 = #Hashie::Mash contributors=nil coordinates=nil created_at=Thu
 Oct
 14 18:35:07 + 2010 favorited=false geo=nil id=27366026129
 in_reply_to_screen_name=nil in_reply_to_status_id=nil
 in_reply_to_user_id=nil place=nil retweet_count=0 retweeted=false
 source=a href=\http://twitter.com/tweetbutton\; rel=\nofollow
 \Tweet Button/a text=Startup Profile: Mobestream Media |
  launchDFWhttp://t.co/3bewuhq...@launchdfw; truncated=false
 user=#Hashie::Mash contributors_enabled=false created_at=Sat Mar
 15
 01:26:52 + 2008 description=ExpatEntrepreneur.tv, Designer 
 Developer -- TweetSaver.com, IncaRentals.com, clkpic.com,
 launchDFW.com, FreshieApp.com, TweetAbout.com, Hire-Engineers.com
 favourites_count=39 follow_request_sent=nil followers_count=1813
 following=nil friends_count=1314 geo_enabled=true id=14150637
 lang=en listed_count=130 location=Lima, Perú name=Bradley
 Joyce
 notifications=nil profile_background_color=cc
 profile_background_image_url=http://a1.twimg.com/
 profile_background_images/98444516/blj_twitter.png
 profile_background_tile=true profile_image_url=http://a3.twimg.com/
 profile_images/421303551/bradley_normal.png
 profile_link_color=a15f3b profile_sidebar_border_color=FF
 profile_sidebar_fill_color=cc profile_text_color=507e94
 profile_use_background_image=true protected=false
 screen_name=bradleyjoyce show_all_inline_media=false
 statuses_count=3248 time_zone=Central Time (US  Canada)
 url=http://
 bradleyjoyce.me utc_offset=-21600 verified=false

 --
 Twitter developer documentation and resources:

 http://dev.twitter.com/docAPI updates via 
 Twitter:http://twitter.com/twitterapi
 Issues/Enhancements Tracker:
http://code.google.com/p/twitter-api/issues/list
 Change your membership to this group:
http://groups.google.com/group/twitter-development-talk

  --
  Twitter developer documentation and resources:http://dev.twitter.com/doc
  API updates via Twitter:http://twitter.com/twitterapi
  Issues/Enhancements Tracker:

 http://code.google.com/p/twitter-api/issues/list Change your membership to 
 this group:

 http://groups.google.com/group/twitter-development-talk

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] Re: Low latency streaming filter updates

2010-04-07 Thread Toby Phipps
John,

Thanks for a quick and on the mark response. Your 10 minute window
suggestion makes a lot of sense, and a maximum of 20 reconnects within
that time should give us what we need for now. This approach does seem
a little outside the 2 minute minimum reconnect period rule as in
the API guide, but if it will not get us banned or frowned upon too
much then I have no issues.

Once we start making a little more noise and closer to launch, we'll
consider requesting firehose access, or even better, hope that
predicate changes without reconnect are ready by then! While I'm on
the topic of new features, let me put my hand up for logical AND
predicate support also!

Regards,
Toby.

On Apr 7, 5:17 am, John Kalucki j...@twitter.com wrote:
 Toby,

 This is indeed a problem. The ultimate solution, irrespective of
 practicality, is to arrange to take the entire firehose.

 Your connections are indeed limited by IP address -- additional accounts,
 past two, will not help much in this use case.

 You can, if so motivated, average your new connections over a larger period,
 allowing lower typical latency. Currently a 10 minute window is configured
 for IP limiting, but we may change that period without notice. You can
 connect quite a few times in a 10 minute window before getting limited by IP
 -- again, subject to change. If you allow, say, 20 connections in 10
 minutes, at any velocity, you should stop accepting new predicates, or only
 update once every 30 seconds until the 10 minute window rolls over. This
 should allow good liveness for many modest arrival rates and temporal
 arrival probability distributions.

 We really need to support updating predicates on live streams to make this
 use case generally practical, short of taking the firehose.

 -John Kaluckihttp://twitter.com/jkalucki
 Infrastructure, Twitter Inc.



 On Tue, Apr 6, 2010 at 11:21 AM, Toby Phipps tphi...@gmail.com wrote:
  Hi,

  I've been reading a lot in the Twitter Streaming API doc and in this
  group about techniques to handle filter updates. I've got a good
  picture of the best practices, but having a hard time applying them to
  my particular situation.

  In my case, I've got a filtered stream where the filters will be
  updated based on the current user activities on my site. The filter
  updates won't happen that frequently, but when they do, they have to
  happen with as little latency as possible. This isn't a big problem in
  probably 80% of the cases where the last filter update happened more
  than 2 minutes ago, as I can happily disconnect and reconnect
  immediately and stay within the rules.

  However when multiple filter updates happen to arrive within the 2
  minutes, that's where I have an issue. The unlucky user whose request
  came in just after a previous update happened gets stuck waiting the
  full 2 minutes before anything happens for them. They'll get bored,
  and walk away!

  The approaches to filter updates in the doc and in this group mainly
  talk about two concurrent streams - one primary stream with an
  elevated role and a second interim stream with default elevation.
  However, this approach works well in allowing filter changes with
  minimal interruption to the high-volume stream, but it does little or
  nothing to reduce the update latency. The worst case update latency is
  still 2 minutes for the poor sucker who came in just after a reconnect
  on the second (default elevation) stream.

  Some of the ideas I'm considering are:

  1. Running four concurrent streams under four different Twitter
  accounts and spreading the overall filter criteria between them all
  (without predicate overlap to prevent wastage). I round-robin any
  filter changes across the streams, so I should be able to average 4x
  less latency. This seems within the rules since I'm using four
  different accounts, but I'm concerned that unless I originate from
  four different IPs that it'll be seen as a grey area and I risk being
  banned.

  2. Bending the rules a little and bringing my minimum time before
  reconnect down to 30 seconds, hoping that if 80% or more of the time I
  respect the 2 minute minimum reconnect interval (and actually stay
  connected a LOT longer in most cases), I can get away with
  reconnecting a little more often during edge cases.

  3. Running a single stream, and when filter changes are needed and I'm
  still within the 2 minute reconnect window, faking a stream with
  multiple queries until the reconnect is allowable at which time I
  transition to the reconnected stream. While this might be strictly
  within the rules, I'm convinced that the multiple query hits while
  waiting for the reconnect window to open would have a higher impact on
  Twitter than an extra reconnect within the 2 minute window every now
  and then.

  Can anyone shed some light on which of these approaches is preferable,
  or propose a different/better one? The goal for me is being able to
  adapt the stream criteria to my

[twitter-dev] Streaming API with Chinese/Japanese language track predicates

2010-04-07 Thread Toby Phipps
Hi,

Has anyone managed to get Japanese or Chinese language track
predicates working with the Streaming API? No matter what I try, I
fail to get any matches using track and any Japanese character, or
word.

I note from the doc that Some UTF-8 keywords will not match
correctly- this is a known temporary defect, however this sounds more
like an edge case, maybe with with certain denormalized Unicode forms.
Does this really extend to pretty much any searching in Chinese/
Japanese?

Some of the predicates I've tried, all which result in no statuses
arriving:

日本 (Japan - shows up as being very frequent via the search API)
よ (A Japanese form of exclamation - again very popular in tweets)
ツイッター (Japanese for Twitter - literally tsu-i-tta)

Given the talk about a hash map being used for status matching, I'm
thinking that this could be because no wordbreaking (n-gram/
morphology) is performed against Chinese/Japanese tweets before they
get added to the hash map, and since most words aren't space-delimited
in these languages, if I don't manage to match an entire sentence, I
won't get a hit. However, all these searches work just fine via the
search API (which I understand is still on a different platform).

Any ideas?

Thanks,
Toby.


Profile image update returns 500 Internal Server Error

2008-12-16 Thread Toby Glenn

I get the 500 Internal Server Error when I try to update a profile
image. I am trying to do it using c# and I am not sure what is going
on. Here is a network sniff of my request:
No. TimeSourceDestination
Protocol Info
657 2.77551410.50.50.230  128.121.146.100
HTTP POST /account/update_profile_image.xml HTTP/1.1  (JPEG JFIF
image)

Frame 657 (85 bytes on wire, 85 bytes captured)
Ethernet II, Src: 00:21:70:6b:00:61 (00:21:70:6b:00:61), Dst:
Watchgua_30:99:52 (00:90:7f:30:99:52)
Destination: Watchgua_30:99:52 (00:90:7f:30:99:52)
Source: 00:21:70:6b:00:61 (00:21:70:6b:00:61)
Type: IP (0x0800)
Internet Protocol, Src: 10.50.50.230 (10.50.50.230), Dst:
128.121.146.100 (128.121.146.100)
Transmission Control Protocol, Src Port: hfcs (4900), Dst Port: http
(80), Seq: 28021, Ack: 26, Len: 31
[Reassembled TCP Segments (28051 bytes): #586(210), #621(129), #622
(1260), #623(1260), #627(1260), #628(1260), #629(1260), #630(1260),
#632(1260), #633(1260), #634(1260), #635(1260), #636(1260), #638
(1260), #639(1260), #640(1260), #641(1260]
Hypertext Transfer Protocol
MIME Multipart Media Encapsulation, Type: multipart/form-data,
Boundary: --8cb2dd5e785fac4
[Type: multipart/form-data]
First boundary: 8cb2dd5e785fac4\r\n
Encapsulated multipart part:  (image/jpeg)
Boundary: \r\n8cb2dd5e785fac4\r\n
Encapsulated multipart part: