Return to Snippet

Revision: 11772
at February 17, 2009 23:29 by neal_grosskopf


Initial Code
<%
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>

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

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

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

Initial Tags
xml, jquery, ASP

Initial Language
jQuery