Fetching contributors…
Cannot retrieve contributors at this time
58 lines (41 sloc) 3.46 KB
Twitter Annotations
by Roy Reshef - royreshef @
UPDATE 2010-08-18, 15:30 EST
Unfortunately Twitter is really putting on hold annotations. I asked them
(@twitterapi, @raffi, @noradio) yesterday and today multiple times to
whitelist @twit4j for annotations (so that the unit test can run smoothly).
I hoped they will realize that Twitter4J is used by many Java developers and
it's not just "another application". I got no reaction, and it wasn't enabled.
Eventually I logged into @twit4j account itself to send a request on behalf
of that account to @twitterapi. And then I finally got the answer
@twit4j Sorry, we're not enabling annotations for additional accounts
at this time. We'll let folks know when we're ready. ^TS
Added support for Twitter Annotations:
1. Files created
2. Files changed
3. Twitter Annotations documentation:
3. Rollout of Annotations feature (by Twitter)
The rollout of the Annotations feature is currently on-hold by Twitter, at least until after the oAuthcalypse (Aug 31). As a result, only developers who have been *whitelisted by Twitter* can call statuses/update for a status with annotations and see annotations of annotated statuses. I have asked @noradio and @raffi yesterday to whitelist the Twitter4J test account, @twit4j. So far I saw no reaction, so I conducted the tests with my test account (@_iskrica), which is whitelisted.
4. Twitter4J Implementation:
- Update status with annotations is only implemented using Twitter.updateStatus(StatusUpdate). See example how to do it in TwitterTestUnit.testAnnotations(). Class StatusUpdate has been modified accordingly.
- The Annotations feature is currently implemented (by Twitter) for the Streaming and REST API. I have modified Status and StatusJSONImpl to support annotations for any status returned by those APIs.
- The Annotations feature is not implemented yet (by Twitter) for the Search API. However, as these were small modifications, for completeness purposes (and for future use) I have modified Tweet and TweetJSONImpl to support annotations. I have tested it, and saw indeed that no annotations are returned by the Search API - even for annotated tweets.
5. Testing
I have tested my code, and verified that I can send a status update with annotations using Twitter4J and get an annotated status by the Streaming/REST API. Example for such a status:
Using Twitter web, you cannot see the annotations. A neat website which allows you to see annotations is (hopefully the Twitter guys will whitelist @twit4j soon).
In order to view it, do the following:
- make @twit4j follow @_iskrica
- go to, which will use oAuth to log into Twitter (as @twit4j)
- select "Deck"
- you are supposed to see there all statuses of the people @twit4j is following. Look for that status of @_iskrica, and you'll see the annotations.