Posted By

neal_grosskopf on 02/17/09


Tagged

xml jquery ASP digg


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

neal_grosskopf
umang_nine
Balamir


How To Get Total Diggs Using JQuery And ASP In 30 Lines Of Code


 / Published in: jQuery
 

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

Learn how to retrieve a specific url's total number of Diggs using JQuery, ASP and the Digg API.

  1. <%
  2. Set objXML = Server.CreateObject("Microsoft.XMLDOM")
  3. objXML.Async = False
  4. objXML.SetProperty "ServerHTTPRequest", True
  5. objXML.ResolveExternals = false
  6. objXML.ValidateOnParse = false
  7. objXML.preserveWhiteSpace = false
  8. objXML.Load("http://services.digg.com/stories/?&appkey=" & Server.URLEncode("http://www.example.com/") & "&type=xml&link=" & request.QueryString("url"))
  9.  
  10. Set objRoot = objXML.documentElement
  11.  
  12. Set objItems = objRoot.getElementsByTagName("story")
  13.  
  14. For Each objItem in objItems
  15. temp = objItem.getAttribute("diggs")
  16. Next
  17.  
  18. Set objRoot = Nothing
  19. Set objItems = Nothing
  20.  
  21. response.Write(temp)
  22. %>
  23. <script type="text/javascript">
  24. $(document).ready(function(){
  25. $.get("digg.asp?url=http://www.example.com/", function(data){
  26. $("#digg").text(data);
  27. });
  28. });
  29. </script>
  30. <p>Digg: <span id="digg"></span></p>

Report this snippet  

You need to login to post a comment.