TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   Yahoo! Grabber (http://www.talkphp.com/advanced-php-programming/2102-yahoo-grabber.html)

xenon 01-26-2008 04:35 PM

Yahoo! Grabber
 
1 Attachment(s)
Me presents the Yahoo! Grabber. Since I've seen many requests over the internet for this one, I wrote a little class to do just this: grab your Yahoo! address book, and since this is one of my favorite forums, I decided to share it with the world :)

Quote:

Yahoo Grabber v1.1

Allows you to log into Yahoo! and fetch the address book in CSV format.
This class is designed to work only with PHP >= 5.0 with the CURL extension enabled.

This library may be used as-is, or extended by a 3rd party, as long as it is used
for non-profit purposes and this copyright notice remains intact. If you do need to use it
for commercial purposes, contact me via the e-mail address specified below and we'll talk about it.
Enjoy it, and if you need to say thanks, you can do it here :-P

WinSrev 01-27-2008 12:16 AM

Works great!
For people that only want the e-mail addresses and not the other stuff, i wrote this little function:

PHP Code:

                // get the address book, the login succeeded
    
$address_book_csv $yahoo->get_address_book();

    echo 
'<pre>';
    
//print_r( $address_book_csv );
    
$i 0;
    while(
$i <= (count($address_book_csv) - 1))
    {
        echo(
$address_book_csv[$i]['email'] . '<br>');
        
$i++;
    }
    echo 
'</pre>'


xenon 01-27-2008 01:40 AM

PHP Code:

while($i <= (count($address_book_csv) - 1)) 

could be rewritten as:

PHP Code:

while($i count($address_book_csv)) 

You can show what ever you want, that's why I chose to return an array of values :-)

PS: the post editor has some serious problems when replying.

kissgeza 10-04-2008 01:03 PM

And new features here:

//print_r( $address_book_csv );
$i = 0;
while($i < count($address_book_csv))
{
echo($address_book_csv[$i]['first'] . ' ');
echo($address_book_csv[$i]['middle'] . ' ');
echo($address_book_csv[$i]['last'] . ' ');
echo($address_book_csv[$i]['email'] . '<br>');
$i++;
}
echo '</pre>';
and nick and etc.. etc... :)


All times are GMT. The time now is 10:31 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0