Tumblr API '标签抓取'脚本没有显示图像

Tumblr API - 'tag crawling' script doesn't show the images

本文关键字:显示 显示图 图像 抓取 API 标签 Tumblr 脚本      更新时间:2023-09-26

我到目前为止有这个。它应该从"赛博朋克"标签中抓取图像并将其发布到<body>,但它不起作用。为什么?关于Tumblr API的更多信息可以在这里找到。

<script>
  $(document).ready(function (){
    var link = "http://api.tumblr.com/v2/tagged?tag=cyberpunk";
    $.ajax({
      type: "GET",
      url : link,
      dataType: "jsonp", 
      data: {
          api_key: "PgAKpKfv1Tcjo1uhsKEuriThhwH9XDJonRobaGwckw8RJt2tos"
      }
    }).done(function( data ) {
      $.each(data.response.posts, function(){
        var _photos = this.photos;
        $.each(_photos, function(){
          $('body').append("<img src='" + this.original_size.url + "'/>");
        });
      });
    });
  });
</script>

data.response,不是data.response.posts,所以

//your code...
//..
 $.each(data.response, function(){ //
//.. rest of your code