{"id":2757,"date":"2017-06-14T01:47:03","date_gmt":"2017-06-13T16:47:03","guid":{"rendered":"http:\/\/taitan916.info\/blog\/?p=2757"},"modified":"2024-01-13T14:39:30","modified_gmt":"2024-01-13T05:39:30","slug":"post-2757","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/2757","title":{"rendered":"WordPress\u306b\u30a4\u30f3\u30b9\u30bf\u30b0\u30e9\u30e0\u306e\u753b\u50cf\u3092\u8868\u793a\u3055\u305b\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>WordPress\u306b\u30a4\u30f3\u30b9\u30bf\u30b0\u30e9\u30e0\u3078\u6295\u7a3f\u3057\u3066\u3044\u308b\u753b\u50cf\u3092\u8868\u793a\u3055\u305b\u305f\u304b\u3063\u305f\u3002\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u300cInstagram Feed\u300d\u3067\u306fHTML\u30bf\u30b0\u69cb\u6210\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3067\u304d\u306a\u3044\u3063\u307d\u3044\u306e\u3067\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u4f7f\u308f\u306a\u3044\u65b9\u5411\u3067\u5bfe\u5fdc\u3057\u305f\u3044\u3002\u4ee5\u4e0b\u306b\u65b9\u6cd5\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3068\u30e6\u30fc\u30b6ID\u3092\u53d6\u5f97<\/h2>\n<p>\u300cInstagram Feed\u300d\u3067\u8a2d\u5b9a\u6642\u306b\u3069\u3061\u3089\u3082\u53d6\u5f97\u3067\u304d\u308b\u3002\u5ff5\u306e\u305f\u3081\u3001\u666e\u901a\u306e\u53d6\u308a\u65b9\u3082\u30e1\u30e2\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u306b\u9077\u79fb\u3057\u3066Register\u306a\u3093\u3061\u3083\u3089\u306e\u3068\u3053\u308d\u304b\u3089\u767b\u9332\u3092\u884c\u3046\u3002<\/p>\n<p><a href=\"https:\/\/www.instagram.com\/developer\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.instagram.com\/developer\/<\/a><\/p>\n<p>\u305d\u3046\u3059\u308b\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8ID\u304c\u767a\u884c\u3055\u308c\u308b\u3002\u307e\u305f\u3001\u767b\u9332\u3057\u305f\u5f8c\u306bSecurity\u30bf\u30d6\u3092\u958b\u3044\u3066\u300cValid redirect URIs\u300d\u306e\u90e8\u5206\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u5148\u306eURL\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3002\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u9069\u5f53\u306b\u81ea\u30b5\u30a4\u30c8\u306eURL\u3092\u767b\u9332\u3059\u308b\u3002<\/p>\n<p>\u3042\u307e\u308a\u3088\u304f\u5206\u304b\u3063\u3066\u306a\u3044\u3051\u3069\u300cDisable implicit OAuth\u300d\u306e\u30c1\u30a7\u30c3\u30af\u306f\u5916\u3057\u3066\u304a\u304f\u306e\u304c\u826f\u3044\u3089\u3057\u3044\u3002<\/p>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8ID\u3068\u30ea\u30c0\u30a4\u30ec\u30af\u30c8URL\u304c\u7528\u610f\u3067\u304d\u305f\u3089\u4ee5\u4e0bURL\u3092\u66f8\u304d\u63db\u3048\u3066\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u958b\u304f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">https:\/\/www.instagram.com\/oauth\/authorize\/?client_id=[\u30af\u30e9\u30a4\u30a2\u30f3\u30c8ID]&amp;redirect_uri=[Valid redirect URIs]&amp;response_type=token<\/pre>\n<p>\u305d\u3046\u3059\u308b\u3068\u8a8d\u8a3c\u3063\u307d\u3044\u30da\u30fc\u30b8\u304c\u958b\u304f\u306e\u3067OK\u7684\u306a\u9078\u629e\u80a2\u3092\u9078\u3076\u3068\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8URL\u306b\u9077\u79fb\u3059\u308b\u3002\u305d\u306e\u969b\u306bURL\u306e\u30af\u30a8\u30ea\u3068\u3057\u3066\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u304c\u767a\u884c\u3055\u308c\u308b\u3002<\/p>\n<p>\u30e6\u30fc\u30b6ID\u306b\u95a2\u3057\u3066\u306f\u4ee5\u4e0b\u30da\u30fc\u30b8\u3067\u30e6\u30fc\u30b6\u540d\u3092\u5165\u529b\u3059\u308b\u3068\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\n<p><a href=\"https:\/\/smashballoon.com\/instagram-feed\/find-instagram-user-id\/\" target=\"_blank\" rel=\"noopener\">https:\/\/smashballoon.com\/instagram-feed\/find-instagram-user-id\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>\u753b\u50cf\u306e\u8868\u793a\u65b9\u6cd5<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?php\r\n$insta_json = file_get_contents('https:\/\/api.instagram.com\/v1\/users\/[\u30e6\u30fc\u30b6ID]\/media\/recent?access_token=[\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3]'); \/\/API\u3092\u53e9\u3044\u3066json\u30c7\u30fc\u30bf\u53d6\u5f97\r\n$insta_data = json_decode($insta_json, true); \/\/json\u30c7\u30fc\u30bf\u3092\u9023\u60f3\u914d\u5217\u306b\r\n$insta_file = dirname(__FILE__) . '\/' . 'insta_file.log'; \/\/\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u30d5\u30a1\u30a4\u30eb\r\nif( $insta_data ){\r\n    file_put_contents($insta_file, serialize($insta_data)); \/\/\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u30d5\u30a1\u30a4\u30eb\u4e0a\u66f8\u304d\r\n}else{\r\n    $insta_data = unserialize(file_get_contents($insta_file)); \/\/\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\r\n}\r\nforeach( $insta_data['data'] as $val ){\r\n?&gt;\r\n    &lt;a href=\"&lt;?php echo $val['link'];?&gt;\" target=\"_blank\"&gt;\r\n        &lt;img src=\"&lt;?php echo $val['images']['thumbnail']['url'];?&gt;\"&gt;\r\n    &lt;\/a&gt;\r\n&lt;?php } ?&gt;<\/pre>\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u30d5\u30a1\u30a4\u30eb\u90e8\u5206\u306b\u95a2\u3057\u3066\u306fAPI\u306e\u4f7f\u7528\u5236\u9650(1\u6642\u9593\u3042\u305f\u308a500\u56de\u307e\u3067)\u5bfe\u7b56\u306b\u306a\u308b\u3002\u5236\u9650\u306b\u3072\u3063\u304b\u304b\u3063\u305f\u308a\u3001\u30a4\u30f3\u30b9\u30bf\u30b0\u30e9\u30e0\u5074\u3067\u4f55\u304b\u3042\u3063\u3066\u901a\u4fe1\u304c\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u8aad\u307f\u8fbc\u3093\u3067\u8868\u793a\u3055\u305b\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u306b\u30a4\u30f3\u30b9\u30bf\u30b0\u30e9\u30e0\u3078\u6295\u7a3f\u3057\u3066\u3044\u308b\u753b\u50cf\u3092\u8868\u793a\u3055\u305b\u305f\u304b\u3063\u305f\u3002\u30d7\u30e9\u30b0\u30a4 ... <\/p>\n","protected":false},"author":1,"featured_media":1093,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[24,41],"tags":[],"class_list":["post-2757","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","category-cms"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/2757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=2757"}],"version-history":[{"count":0,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/2757\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/1093"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=2757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=2757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=2757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}