Info Zone

Hiking On The Web For Technology

Using PHP curl to fetch post from del.icio.us

July 14th, 2007 by Henry Addo

Been playing with del.icio.us’s api to pull my del.icio.us ( very hard writing that ) post. php’s curl made everything smooth. Below is the code. Feel free to comment on it.

$fetch_url ="https://api.del.icio.us/v1/posts/all?";
$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, $fetch_url );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $curl, CURLOPT_USERPWD,"your username:your password");
curl_setopt( $curl, CURLOPT_CONNECTTIMEOUT, 30 );
curl_setopt( $curl, CURLOPT_TIMEOUT,5 );
curl_setopt( $curl, CURLOPT_POST, 1 );
$response = curl_exec( $curl );
curl_close( $curl );
header("Content-Type:text/xml");
echo $response;

Posted in , , , |

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.