Posted By

neal_grosskopf on 02/16/09


Tagged

jquery json


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

neal_grosskopf
umang_nine
LeeRJohnson
maxvee8


How To Get Delicious Bookmark Total Using JQuery And JSON


 / Published in: jQuery
 

URL: http://www.nealgrosskopf.com/tech/thread.asp?pid=34

Find out how to retrieve a count of the total times users have bookmarked your web site or web page on Delicious by using JQuery and JSON. The code is pretty simple and can be done in under 18 lines of code.

  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
  2. <script type="text/javascript" src="jquery.md5.js"></script>
  3.  
  4.  
  5. <script type="text/javascript">
  6. $(document).ready(function(){
  7.  
  8. url = "http://www.nealgrosskopf.com/tech/thread.asp?pid=17"
  9.  
  10. $.ajax({ type: "GET",
  11. dataType: "jsonp",
  12. url: "http://feeds.delicious.com/v2/json/urlinfo/"+$.md5(url),
  13. success: function(data){
  14. if (data.length > 0) {
  15. $("#delicious").text(data[0].total_posts);
  16. }
  17. }
  18. });
  19.  
  20. });
  21. </script>
  22.  
  23. p>Delicious: <span id="delicious"></span></p>

Report this snippet  

You need to login to post a comment.