views:

2504

answers:

2

So, the twitter API has the method "statuses/update":

URL:
http://twitter.com/statuses/update.format

Formats: 
xml, json, rss, atom 

HTTP Method(s):
POST

Requires Authentication (about authentication):
true

API rate limited (about rate limiting):
false

Parameters:

    * status.  Required.  The text of your status update. URL encode as necessary. Statuses over 140 characters will be forceably truncated.
    * in_reply_to_status_id.  Optional. The ID of an existing status that the update is in reply to.

How would you call this method with objective-c (iphone)?

+4  A: 

Look around for either twitter or json to objective-c libraries to communicate with twitter There's a JSON framework with iPhone SDK 2.2 as an example.

There's a iPhone dev course at Stanford on iTunes, they were working on Twitter app which included examples of how to get data from Twitter. Google around.

stefanB
+7  A: 

Rather than implementing the API on your own, you might prefer to use a Cocoa framework that has already been written. There are a few, but the most commonly used (as far as I can tell) is MGTwitterEngine.

If you do want to do it by hand, you would use NSURLConnection to download the data and then whatever you need to parse the output (NSXMLParser for XML, a bit harder for JSON).

Stephen Darlington
@Stephen Darlington I have seen your comment on above. Now, I am trying to validate TWitter account via OAuth. is this possible to do that? and also I am struggling with implement an OAuth in my apps for last two weeks. please guide me!
Sivanathan
The top two Google results for "MGTwitterEngine OAuth" should help. There's also another StackOverflow question about using MGTwitterEngine with OAuth: http://stackoverflow.com/questions/1965218/twitter-oauth-with-mgtwitterengine
Stephen Darlington