エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
コード require 'net/https' require 'json' module Google module UrlShortener def self.shorten_url(... コード require 'net/https' require 'json' module Google module UrlShortener def self.shorten_url(url, api_key=nil) send_request { req = Net::HTTP::Post.new("/urlshortener/v1/url#{api_key ? '?key=' + api_key : ''}", 'Content-Type' => 'application/json') req.body = "{'longUrl':'#{url}'}" req }["id"] end def self.expand_url(short_url, api_key=nil) send_request { Net::HTTP::Get.new("/urlshortener/v1/url?