/ Published in: jQuery

Learn how to retrieve a specific url's total number of Diggs using JQuery, ASP and the Digg API.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<% Set objXML = Server.CreateObject("Microsoft.XMLDOM") objXML.Async = False objXML.SetProperty "ServerHTTPRequest", True objXML.ResolveExternals = false objXML.ValidateOnParse = false objXML.preserveWhiteSpace = false objXML.Load("http://services.digg.com/stories/?&appkey=" & Server.URLEncode("http://www.example.com/") & "&type=xml&link=" & request.QueryString("url")) Set objRoot = objXML.documentElement Set objItems = objRoot.getElementsByTagName("story") For Each objItem in objItems temp = objItem.getAttribute("diggs") Next Set objRoot = Nothing Set objItems = Nothing response.Write(temp) %> <script type="text/javascript"> $(document).ready(function(){ $.get("digg.asp?url=http://www.example.com/", function(data){ $("#digg").text(data); }); }); </script> <p>Digg: <span id="digg"></span></p>
URL: http://www.nealgrosskopf.com/tech/thread.asp?pid=35
Comments
