/ Published in: PHP
an easy-to-use function to connect to your del.icio.us account and perform a query. query commands can be found on their api help: http://delicious.com/help/api
Expand |
Embed | Plain Text
<?php /** * Delicious_query(); * @author: Stephane P. Pericat * @date: 2009-12-14 * * @param : $credentials(array), $request(string) * @return: simpleXML object */ throw new InvalidArgumentException("no credentials provided"); } $username = $credentials["username"]; $password = $credentials["password"]; $base_url = "https://".$username.":".$password."@api.del.icio.us/v1/"; $full_url = $base_url.$request; $ch = curl_init($full_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $query = curl_exec($ch); curl_close($ch); return simplexml_load_string($query); } "password" => "your_password"); $query = delicious_query($creds, "posts/all?tag=php");
You need to login to post a comment.
