return specific values from youtube

Posted by user1631487 on Stack Overflow See other posts from Stack Overflow or by user1631487
Published on 2012-08-28T21:16:23Z Indexed on 2012/08/28 21:38 UTC
Read the original article Hit count: 203

Filed under:
|
|
|
|

I am trying to write a small function that will allow a user to submit a specific youtube channel url, and then return the number of views on the channel. Anyobne have any ideas?

<!DOCTYPE html>
<html>
<head>
</head>
<body>

<p id="demo">Click the button to get the value of the attribute with the specified   namespaceURI and name</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction()
{
var http;
if (window.XMLHttpRequest)  {xhttp=new XMLHttpRequest();}
else  {xhttp=new ActiveXObject("Microsoft.XMLHTTP");}

xhttp.open("GET","booksns.xml",false);
xhttp.send();
var xmlDoc=xhttp.responseXML;
var price=xmlDoc.getElementsByTagName("price")[0];
var x=document.getElementById("demo");
x.innerHTML=price.getAttributeNS("http://www.w3schools.com/NS","currency");
};
</script>
</body>
</html>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about forms