-
-
Save lslucas/1049329 to your computer and use it in GitHub Desktop.
Revisions
-
thiagosf created this gist
Jun 27, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,75 @@ <?php // Mais informações // http://www.delicious.com/help/feeds // Count function delicious_count($url) { $count = 0; $jsonurl = "http://feeds.delicious.com/v2/json/urlinfo/" . md5($url); $json = file_get_contents($jsonurl,0,null,null); $json_output = json_decode($json, true); if (!empty($json_output)) { $del_count = $json_output[0]['total_posts']; $del['count'] = $del_count; $del['lastcheck'] = mktime(); $del = serialize($del); $count = ($del_count == null) ? 0 : $del_count; } return $count; } // Bookmarks for a specific user by tag(s): function delicious_bookmarks ($user, $tag = null) { $jsonurl = 'http://feeds.delicious.com/v2/json/'.$user.'/'.$tag; $json = file_get_contents($jsonurl,0,null,null); $json_output = json_decode($json, true); if (!empty($json_output)) { return $json_output; } } // Popular bookmarks by tag: function delicious_popular ($tag = null) { $jsonurl = 'http://feeds.delicious.com/v2/json/popular/'.$tag; $json = file_get_contents($jsonurl,0,null,null); $json_output = json_decode($json, true); if (!empty($json_output)) { return $json_output; } } ?>