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.
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
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/