Вопрос

I'm trying to access the top ten trending videos of youtube using their API's. On their website it says use the get request to the link https://gdata.youtube.com/feeds/api/standardfeeds/on_the_web. How would I implement this in Javascript and how exactly would I store the results? Would it be in an array?

Thanks in advance!

Это было полезно?

Решение

To issue get request you may use jQuery: http://api.jquery.com/jQuery.get/

The result will be text of HTML page (it comes in get request callback). To make it into array you should parse it yourself. Since the page is simple, I think regular expressions will be enough: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top