How To Get Delicious Bookmark Total Using JQuery And JSON


/ Published in: jQuery
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  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>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.