{"id":2330,"date":"2017-01-01T23:34:27","date_gmt":"2017-01-01T14:34:27","guid":{"rendered":"http:\/\/daily.belltail.jp\/?p=2330"},"modified":"2017-01-01T23:39:43","modified_gmt":"2017-01-01T14:39:43","slug":"youtube-data-api-v3%e3%81%a8google-api-ruby-client-gem%e3%81%a7youtube%e5%8b%95%e7%94%bb%e6%a4%9c%e7%b4%a2","status":"publish","type":"post","link":"https:\/\/daily.belltail.jp\/?p=2330","title":{"rendered":"YouTube Data API V3\u3068google-api-ruby-client gem\u3067YouTube\u52d5\u753b\u691c\u7d22"},"content":{"rendered":"<p>\u3053\u306e\u5ea62017\u5e741\u67081\u65e5\u3092\u8fce\u3048\u307e\u3057\u305f\u3002\u795e\u6238\u6e2f\u958b\u6e2f150\u5e74\u3067\u3042\u308a\u3001\u795e\u6238\u6e2f\u306b\u5efa\u3064\u5de8\u5927\u306a\u9b5a\u306e\u30aa\u30d6\u30b8\u30a7\u300c\u30d5\u30a3\u30c3\u30b7\u30e5\u30fb\u30c0\u30f3\u30b9\u300d\u304c\u516c\u958b\u3055\u308c\u306630\u5e74\u3067\u3082\u3042\u308a\u307e\u3059\u3002\u795e\u6238\u6e2f\u306b\u306f\u7e01\u3082\u3086\u304b\u308a\u3082\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3055\u3066\u3001\u81ea\u4f5c\u30b5\u30fc\u30d3\u30b9(Rails\u88fd)\u306e\u88cf\u5074\u306b\u304a\u3044\u3066YouTube\u3067\u306e\u52d5\u753b\u691c\u7d22\u3092\u3057\u305f\u3044\u3068\u8003\u3048\u3066\u3044\u3066\u3001YouTube Data API(V3)\u304a\u3088\u3073\u305d\u308c\u3092\u53e9\u304fGoogle\u88fd\u306egoogle-api-ruby-client gem\u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<br \/>\n\u3057\u304b\u3057\u306a\u304c\u3089\u3053\u306eGem\u306f2016\u5e74\u521d\u982d\u306b\u51fa\u305f0.9\u306b\u3088\u3063\u3066\u5927\u304d\u306a\u5909\u66f4\u304c\u5165\u308a\u3001<strong>\u516c\u5f0f\u306e\u3082\u306e\u3092\u542b\u3081<\/strong>\u30cd\u30c3\u30c8\u4e0a\u3067\u95b2\u89a7\u53ef\u80fd\u306a\u30b5\u30f3\u30d7\u30eb\u306e\u307b\u3068\u3093\u3069\u304c\u53c2\u8003\u306b\u306a\u3089\u306a\u3044\u72b6\u6cc1\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u81ea\u5206\u3067\u3082\u5c11\u3057\u82e6\u52b4\u3057\u305f\u306e\u3067\u3001\u304b\u3093\u305f\u3093\u306b\u30e1\u30e2\u3002<\/p>\n<p>\u60c5\u5831\u306f2017\u5e741\u67081\u65e5JST\u73fe\u5728\u3001Gem\u306f0.9.20\u3067\u3059\u3002<\/p>\n<p>[:contents]<\/p>\n<p><!--more--><\/p>\n<p>* API\u30ad\u30fc\u3092\u4f7f\u3063\u3066\u52d5\u753b\u691c\u7d22<\/p>\n<p>\u4eca\u56de\u306fAPI\u30ad\u30fc\u3092\u4f7f\u3063\u3066\u76f4\u63a5\u60c5\u5831\u3092\u5f97\u308b\u65b9\u6cd5\u306e\u307f\u6271\u3044\u3001OAuth\u3092\u884c\u3046\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u4ed6\u306b\u8b72\u308a\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001Google Developers\u304b\u3089API\u30ad\u30fc\u3092\u53d6\u5f97\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n[https:\/\/console.developers.google.com\/apis\/api\/youtube\/overview:title=Google APIs &gt; API Manager &gt; YouTube Data API v3]\u3067\u81ea\u5206\u306e\u30a2\u30d7\u30ea\u7528\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057Enable API\u3067API\u3092\u6709\u52b9\u5316\u3057\u3001\u30ad\u30fc\u3092\u3068\u3063\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/daily.belltail.jp\/?attachment_id=2331\" rel=\"attachment wp-att-2331\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-2331\" src=\"http:\/\/daily.belltail.jp\/wp-content\/uploads\/2017\/01\/api_manager.png\" alt=\"\" width=\"469\" height=\"191\" srcset=\"https:\/\/daily.belltail.jp\/wp-content\/uploads\/2017\/01\/api_manager.png 2160w, https:\/\/daily.belltail.jp\/wp-content\/uploads\/2017\/01\/api_manager-300x123.png 300w, https:\/\/daily.belltail.jp\/wp-content\/uploads\/2017\/01\/api_manager-768x314.png 768w, https:\/\/daily.belltail.jp\/wp-content\/uploads\/2017\/01\/api_manager-1024x418.png 1024w, https:\/\/daily.belltail.jp\/wp-content\/uploads\/2017\/01\/api_manager-1200x490.png 1200w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/a><\/p>\n<p>\u3064\u3065\u3044\u3066\u306f\u624b\u5143\u306eRuby\u74b0\u5883\u306bGem\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% gem install google-api-client -v 0.9.20\r\n<\/pre>\n<p>\u3053\u308c\u3067\u3001\u30ad\u30fc\u30ef\u30fc\u30c9[https:\/\/ja.wikipedia.org\/wiki\/%E3%83%AC%E3%83%8E%E3%83%95%E3%82%A1%E5%B1%B1%E5%8F%A3FC:title=\u30ec\u30ce\u30d5\u30a1]\u3067\u3001\u300c\u904e\u53bb1\u30f6\u6708\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u305f\u52d5\u753b\u309250\u4ef6\u5358\u4f4d\u3067\u5168\u3066\u53d6\u5f97\u300d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><script src=\"https:\/\/gist.github.com\/belltailjp\/933bfec95c94a224661bd04c31012c29.js\"><\/script><\/p>\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3053\u3093\u306a\u304b\u3093\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% ruby search.rb\r\n&quot;\u95a2\u6771\u7b2c\u4e00\u9ad8\u6821\u306e\u30ec\u30ce\u30d5\u30a1\u5c71\u53e3\u5b8c\u30b3\u30d4\u5fdc\u63f4&quot; by K Onishi (2017-01-01T03:45:54+00:00)\r\n&quot;\u30ec\u30ce\u30d5\u30a1\u5c71\u53e3 \u4e09\u5e78\u9078\u624b&quot; by \u304b\u305a\u304b\u305a \u304b\u305a\u304b\u305a (2016-12-31T14:55:21+00:00)\r\n&quot;20161228\u3000VS\u3000\u30ec\u30ce\u30d5\u30a1\u5c71\u53e3\u3000\u2460&quot; by \u5cb3\u90a6\u9ad8\u6a4b (2016-12-29T07:19:14+00:00)\r\n&quot;20161228\u3000VS\u3000\u30ec\u30ce\u30d5\u30a1\u5c71\u53e3\u3000\u2461&quot; by \u5cb3\u90a6\u9ad8\u6a4b (2016-12-29T07:19:14+00:00)\r\n&quot;\u30ec\u30ce\u30d5\u30a1\u5c71\u53e3 \u30ab\u30e9\u30fc\u30b4\u30fc\u30eb\u30cd\u30c3\u30c8\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3000\u8d08\u5448\u5f0f\u76f4\u5f8c\u306e\u8a18\u5ff5\u64ae\u5f71&quot; by Anderson Tyler (2016-12-26T14:49:07+00:00)\r\n&quot;\uff12\uff10\uff11\uff10\uff23\uff33\uff2c\u3000\uff2a\uff26\uff25\u897f\u65e5\u672c\uff0d\u30ec\u30ce\u30d5\u30a1\u5c71\u53e3\u3000\u30ea\u30e5\u30fc\u30bb\u30a4\u306e\u30b4\u30fc\u30eb&quot; by Anderson Tyler (2016-12-26T14:45:07+00:00)\r\n&quot;2014\uff2a\u30e6\u30fc\u30b9\u30ab\u30c3\u30d7 \u4e2d\u56fd\u4e88\u9078 \u30ec\u30ce\u30d5\u30a1\u5c71\u53e3U-18 \uff0d \u30a2\u30af\u30fc\u30c8\u5ca1\u5c71\u3000\uff03\uff11\uff16\u6cb3\u91ce\u306e\uff12\u70b9\u76ee&quot; by Anderson Tyler (2016-12-26T14:34:28+00:00)\r\n&quot;JFL 2nd \u7b2c3\u7bc0\u3000\u30ec\u30ce\u30d5\u30a1\u5c71\u53e3\uff0d\u30bd\u30cb\u30fc\u4ed9\u53f0\u3000\uff03\uff19\u5cb8\u7530\u306e\u5148\u5236\u30b4\u30fc\u30eb&quot; by Anderson Tyler (2016-12-26T14:33:40+00:00)\r\n...\r\n<\/pre>\n<p><em>list_searches<\/em>\u306f1\u30da\u30fc\u30b8\u5206\u306e\u60c5\u5831\u3092\u8fd4\u3059\u3068\u3068\u3082\u306b\u3001\u6b21\u306e\u30da\u30fc\u30b8\u3092\u793a\u3059\u8b58\u5225\u5b50\u3068\u306a\u308b\u30c8\u30fc\u30af\u30f3\u3092\u8fd4\u3057\u307e\u3059\u3002\u305d\u308c\u304c\u30ec\u30b9\u30dd\u30f3\u30b9\u306e<em>next_page_token<\/em>\u3067\u3001\u6b21\u306eAPI\u547c\u3073\u51fa\u3057\u306e\u969b\u306b\u306f<em>page_token<\/em>\u306b\u305d\u306e\u5024\u3092\u6e21\u3059\u3053\u3068\u3067\u3001\u6b21\u3005\u3068\u30da\u30fc\u30b8\u3092\u6700\u5f8c\u307e\u3067\u305f\u3050\u3063\u3066\u3044\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306e\u30da\u30fc\u30b8\u3067null\u3092\u8fd4\u3057\u307e\u3059\u3002\u307e\u305f\u6700\u521d\u306e\u30da\u30fc\u30b8\u306b\u6e21\u3059<em>page_token<\/em>\u306fnull(nil)\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u4ed6\u306e\u30b3\u30fc\u30c9\u306e\u89e3\u8aac\u306f\u7279\u306b\u4e0d\u8981\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>* \u60c5\u5831\u6e90<\/p>\n<p>google-api-ruby-client gem\u306b\u95a2\u3057\u3066\u306f\u3001[https:\/\/developers.google.com\/youtube\/v3\/code_samples\/ruby?hl=ja:title=\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8]\u306f(2017\u5e741\u67081\u65e5\u73fe\u5728)\u53e4\u3044\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u89e3\u8aac\u306e\u307f\u3067\u3001\u3042\u307e\u308a\u53c2\u8003\u306b\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3057\u305f\u304c\u3063\u3066\u5f53\u9762\u306e\u3068\u3053\u308d\u306f\u3001\u57fa\u672c\u7684\u306b\u30bd\u30fc\u30b9\u3084generated documenet\u3001\u304a\u3088\u3073Web API\u305d\u306e\u3082\u306e\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u898b\u3066\u3044\u304f\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u4eca\u56de\u4f7f\u3063\u305f\u52d5\u753b\u691c\u7d22\u306eAPI\u3067\u306f\u3001<br \/>\n\u307e\u305a\u306f[http:\/\/www.rubydoc.info\/github\/google\/google-api-ruby-client\/Google\/Apis\/YoutubeV3\/YouTubeService#list_searches-instance_method:title=gem\u306egenerated document\u306e\u4e2d\u304b\u3089\u305d\u308c\u3089\u3057\u304d\u30e1\u30bd\u30c3\u30c9\u3092\u898b\u3064\u3051\u3066\u304d\u3066]\u3001\u307e\u305f\u5fc5\u8981\u306b\u5fdc\u3058\u3066[https:\/\/github.com\/google\/google-api-ruby-client\/blob\/1f7cb2446a390c7237ce37005349f93208ebe775\/generated\/google\/apis\/youtube_v3\/service.rb#L3458:title=gem\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9]\u3082\u898b\u3064\u3064\u3001\u305f\u3060\u305d\u3053\u306b\u306f\u5f15\u6570\u306b\u5177\u4f53\u7684\u306b\u3069\u3093\u306a\u5024\u3092\u4e0e\u3048\u308b\u3079\u304d\u306a\u306e\u304b\u306f\u5168\u304f\u8a18\u8f09\u304c\u306a\u3044\u305f\u3081\u3001[https:\/\/developers.google.com\/youtube\/v3\/docs\/search\/list?hl=ja#order:title=API\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u691c\u7d22\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u4ed5\u69d8]\u3092\u773a\u3081\u306a\u304c\u3089Ruby\u4e0a\u3067\u3069\u306e\u3088\u3046\u306a\u4f7f\u3044\u65b9\u3092\u3059\u308b\u306e\u304b\u884c\u9593\u3092\u8aad\u307f\u3064\u3064\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u3057\u3066\u3044\u304f\u3088\u3046\u306a\u6d41\u308c\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u8a8d\u8a3c\u5468\u308a\u306b\u3064\u3044\u3066\u306f\u3001google-api-ruby-client gem\u5168\u4f53\u3068\u3057\u3066\u3001\u3064\u307e\u308aYouTube\u306b\u9650\u3089\u305aCalendar\u3084Drive\u306a\u3069\u3067\u5171\u901a\u306e\u4ed5\u7d44\u307f(googleauth)\u306b\u8f09\u3063\u304b\u3063\u3066\u3044\u3066\u3001\u305d\u308c\u3089\u306e\u4f8b\u306f\u6bd4\u8f03\u7684\u5bb9\u6613\u306b\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u6301\u3063\u3066\u304f\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3082\u3046\u52d5\u753b\u3092\u30b4\u30ea\u30b4\u30ea\u843d\u3068\u3057\u3066\u304d\u3066\u6620\u50cf\u89e3\u6790\u306b\u3076\u3061\u8fbc\u3080\u306a\u3093\u3066\u306e\u3082\u304a\u8336\u306e\u5b50\u3055\u3044\u3055\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u5ea62017\u5e741\u67081\u65e5\u3092\u8fce\u3048\u307e\u3057\u305f\u3002\u795e\u6238\u6e2f\u958b\u6e2f150\u5e74\u3067\u3042\u308a\u3001\u795e\u6238\u6e2f\u306b\u5efa\u3064\u5de8\u5927\u306a\u9b5a\u306e\u30aa\u30d6\u30b8\u30a7\u300c\u30d5\u30a3\u30c3\u30b7\u30e5\u30fb\u30c0\u30f3\u30b9\u300d\u304c\u516c\u958b\u3055\u308c\u306630\u5e74\u3067\u3082\u3042\u308a\u307e\u3059\u3002\u795e\u6238\u6e2f\u306b\u306f\u7e01\u3082\u3086\u304b\u308a\u3082\u3042\u308a\u307e\u305b\u3093\u3002 \u3055\u3066\u3001\u81ea\u4f5c\u30b5\u30fc\u30d3\u30b9(Rails\u88fd)\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[23,38],"class_list":["post-2330","post","type-post","status-publish","format-standard","hentry","category-1","tag-ruby","tag-38"],"_links":{"self":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts\/2330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2330"}],"version-history":[{"count":6,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts\/2330\/revisions"}],"predecessor-version":[{"id":2337,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts\/2330\/revisions\/2337"}],"wp:attachment":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}