views:

35

answers:

2

I'm nearly finished building a simple web application that would really benefit from integration with Twitter through its API. I think the best way to do this would be through following and direct messages similar to how RTM has chosen to interact with users through Twitter. I learn best by analyzing examples, so I would like to find some good examples that illustrate how to use the Twitter API for interaction with users. Thank you.

My web application uses PHP and MySQL.

+1  A: 

This is a pretty good article / set of examples for using the PEAR Services_Twitter library to do a bunch of different twitter actions including direct messages and following.

Using the Twitter API with PHP and PEAR: http://devzone.zend.com/article/4431

It is a year old though, so it doesn't use OAUTH. To find an example of that, check out the documentation:

http://pear.php.net/package/Services_Twitter/docs/latest/Services_Twitter/Services_Twitter.html

daryn
This is worthwhile information, but it doesn't really provide examples consistent with the interaction I'm looking for.
David
A: 

The Twitter API supports cUrl, so you can use that library to send the necessary headers and retrieve the data you require. A good example here:

http://applicationdeveloper.net/2009/07/12/post-twitter-curl/

DeaconDesperado
David was asking for examples of how to do some of the things that RTM does; your link is just a trivial example of posting a status update.
daryn
That's the HTTP Basic Auth. It's being phased out in favor of OAuth. That link will soon stop being useful information.
Kalium