LoginSignup
1
1

More than 5 years have passed since last update.

Instagramの写真持ってきてスライドショー/メモ

Posted at

スライドショー - http://als.musings.it
クライアント-number-id - http://jelled.com/instagram/lookup-user-id
クライアントID - https://instagram.com/developer/clients/manage/

instagram.html
<!DOCTYPE HTML>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" type="text/css" media="screen" href="als.css" />
    <script type="text/javascript" src="jquery.min.js"></script>
    <script type="text/javascript" src="jquery.als-1.7.min.js"></script>
    <script type="text/javascript">
      $(document).ready(function() {
        $.ajax({
          //url: 'https://api.instagram.com/v1/tags/タグ/media/recent?count=33&client_id=クライアントID',
          url: 'https://api.instagram.com/v1/users/クライアント-number-id/media/recent?client_id=クライアントID&count=33',
          cache: false,
          dataType: 'jsonp'
        }).done(function( msg ) {
          var result = new Array();
          $.each(msg.data, function(index, value) { 
            var link = value.link;
            var imageUrl = value.images.low_resolution.url;
            var instaId = value.id;
            result.push('<div class="multiple"><a href="'+link+'" target="_blank"><img border="0" src="'+imageUrl+'" width="210" /></a></div>');
          });
          $(".slider").html(result.join(""));
          $('.autoplay').slick({
            dots: false,
            slidesToShow: 6,
            slidesToScroll: 1,
            autoplay: true,
            autoplaySpeed: 2000,
          });
        });
      });
    </script>
  </head>
  <body>

    <div class="slider autoplay" style="height:210px;"></div>

  </body>
</html>
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1