0

I made a small script that use request:

request({
  url: "http://gdata.youtube.com/feeds/api/videos?alt=json&max-results=1&q=" + encodeURIComponent(trackName),
  json: true
}, function (dataAndEvents, deepDataAndEvents, data) {
});

and now I want to port it to android using Ionic Framework. Is it possible to get and download easily urls?

4

1 回答 1

2

Ionic 是基于 Angular 构建的,因此您可以使用$http方法来请求远程数据。

$http({
    url: 'http://gdata.youtube.com/feeds/api/videos',
    params: {
      alt: 'json',
      max-results: 1,
      q: trackName
    }
  })
  .success(function(data, status) {
    console.log(data);
  })
  .error(function(data, status) {
    console.log('error');
  });
于 2014-06-18T15:45:24.050 回答