1jQuery(function($){ 2 3 /* ---------------------------------------------------------------------- 4 ã¤ã³ã¹ã¿åãè¾¼ã¿ãinstagram API ver7対å¿ç 5 ---------------------------------------------------------------------- */ 6 /* ãã³ãã¬ã¼ãURIèªã¿è¾¼ã¿ -------------------------------*/ 7 var wp_theme_uri = tmp_path.theme_uri; //åãã¼ãè¨ç½®ãã£ã¬ã¯ããªå¼ã³åºã 8 var wp_home_url = tmp_path.home_url; //WPã¢ãã¬ã¹å¼ã³åºã 9 10 /* ã¤ã³ã¹ã¿ã®è¡¨ç¤ºæ°å¶å¾¡ -------------------------------*/ 11 12 //ã1ãã¹ããã¨PCã§è¡¨ç¤ºæ°ãå¤ããå ´åã¯ãã¡ãã®ifæãä½¿ç¨ 13 // if( $(window).width() < 767 ){ 14 // var photoLength = 3;//ã¹ããã§è¡¨ç¤ºããæ° 15 // } else { 16 // var photoLength = 6//PCã§è¡¨ç¤ºããæ° 17 // } 18 19 //ã2ãã¹ããã¨PCã§è¡¨ç¤ºæ°ãå¤ãããªãå ´åã¯ãã¡ããä½¿ç¨ 20 var photoLength = 6;//PCã»ã¹ããã§è¡¨ç¤ºããæ° 21 22 23 /* è¤æ°ãã¼ã¸ã«å¥ã ã®ã¢ã«ã¦ã³ãã®ã¤ã³ã¹ã¿ãåãè¾¼ãå ´åã¯ãã¡ããæå¹ ------------------------------- 24 //å®è¡ãã¼ã¸ã®URLãåå¾ 25 var url = location.href; 26 27 //ãã¼ã¸æ¯ãåãç¨ãã¤ã³ã¹ã¿ãã¨ã«PHPãã¡ã¤ã«ãæºåãã¦ãã ãã 28 if (url.match(/aaa/)) { 29 var page = wp_theme_uri + "/php/instagramFeed-aaa.php"; 30 }else if (url.match(/bbb/)) { 31 var page = wp_theme_uri + "/php/instagramFeed-bbb.php"; 32 }else if (url.match(/ccc/)) { 33 var page = wp_theme_uri + "/php/instagramFeed-ccc.php"; 34 } 35 */ 36 37 /* å ¨ãã¼ã¸å ±éã§1ã¤ã®ã¢ã«ã¦ã³ãã®ã¤ã³ã¹ã¿ãåãè¾¼ãå ´åã¯ãã¡ããæå¹ -------------------------------*/ 38 var page = wp_theme_uri + "/php/instagramFeed.php"; 39 40 41 /* åãè¾¼ã¿ã¹ã¯ãªããæ¬ä½ -------------------------------*/ 42 axios.get(page).then(function(instagram_data) { 43 console.log(instagram_data);// æ¤è¨¼ãã¼ã«ã®Consoleãè¦ãã¨åå¾ãããã¼ã¿ã®å ¨å®¹ã確èªã§ãã¾ãã 44 45 //ä»ã®Instagramãã¸ãã¹ã¢ã«ã¦ã³ãã®æç¨¿æ å ±ãåå¾ãããå ´åã¯ãã¡ããæå¹ 46 //const gallery_data = instagram_data["data"]["business_discovery"]["media"]["data"]; 47 48 //èªåã®Instagramãã¸ãã¹ã¢ã«ã¦ã³ãã®æç¨¿æ å ±ãåå¾ã§ããã°OKãªå ´åã¯ãã¡ããæå¹ 49 const gallery_data = instagram_data["data"]["media"]["data"]; 50 51 let photos = ""; 52 const photo_length = photoLength; 53 54 for(let i = 0; i < photo_length ;i++){ 55 56 if(gallery_data[i].thumbnail_url){ 57 photos += '<li class="gallery-item"><a href="' + gallery_data[i].permalink + '" target="_blank" /><img src="' + gallery_data[i].thumbnail_url + '" loading="lazy" alt="' + gallery_data[i].caption + '" /></a></li>'; 58 } else { 59 photos += '<li class="gallery-item"><a href="' + gallery_data[i].permalink + '" target="_blank" /><img src="' + gallery_data[i].media_url + '" loading="lazy" alt="' + gallery_data[i].caption + '" /></a></li>'; 60 } 61 } 62 63 document.querySelector("#instaGallery").innerHTML = photos; 64 }).catch(function(error) { 65 console.log(error); 66 }) 67 68});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.