I don't have any pure tutorials, but this PHP class might be a good place to
start:
http://code.google.com/p/php-twitter/source/browse/trunk/class.twitter.php

It includes a method to retrieve DMs. The hardest part for me when I rolled
my own in PHP was parsing the results into a native structure. It's easier
to use a pre-built library like this, unless you want the learning
experience of building it all yourself.

The original class included a couple of simple examples in the comments. I
haven't tested, but I think they may still work with the latest version:

// Example 1:
//
// $t= new twitter();
// $res = $t->publicTimeline();
// if($res===false){
//   echo "ERROR<hr/>";
//     echo "<pre>";
//   print_r($t->responseInfo);
//     echo "</pre>";
// }else{
//   echo "SUCCESS<hr/>";
//     echo "<pre>";
//   print_r($res);
//     echo "</pre>";
// }
//
//
// Example 2:
//
// $t= new twitter();
// $t->username='username';
// $t->password='password';
// $res = $t->update('i am testing twitter.class.php');
// if($res===false){
//   echo "ERROR<hr/>";
//     echo "<pre>";
//   print_r($t->responseInfo);
//     echo "</pre>";
// }else{
//   echo "SUCCESS<hr/>Status Posted";
// }

Hope that helps,

Pete

On Sat, Feb 21, 2009 at 9:26 PM, TjL <[email protected]> wrote:

>
> I know just enough PHP to be dangerous, but I'd like to start to play
> around with the API when designing web pages.
>
> Is there a "for dummies" or similar basic set of examples somewhere?
> I've never done API stuff (any API) via PHP.
>
> (for starters: I'd like to build myself a custom DM page which shows
> "threaded" (at least time-sorted) messages sent and received. I seem
> to always forget what I've been talking about with people and then
> they DM me and I have to go back and try to piece it together.)
>
> Thanks
> TjL
>

Reply via email to