module OchibakoShare
Constants
- ACCESS_TOKEN_FILE
- APP_KEY_FILE
- VERSION
Public Instance Methods
db_download_url(url)
click to toggle source
# File lib/ochibako_share.rb, line 23 def db_download_url(url) url.sub(/\?dl=0\z/, '?dl=1') end
follow_url(url, limit = 8)
click to toggle source
# File lib/ochibako_share.rb, line 12 def follow_url(url, limit = 8) raise RuntimeError, "Too many HTTP redirects" if limit == 0 res = Net::HTTP.get_response(URI.parse(url)) if Net::HTTPRedirection === res return follow_url(res['location'], limit - 1) else return url end end