fix bugs
This commit is contained in:
parent
097b781a27
commit
65920c0f69
|
@ -34,11 +34,7 @@ class VideosController < ApplicationController
|
|||
result = JSON.parse(result)
|
||||
|
||||
vc = []
|
||||
video_channels.each do |video_channel|
|
||||
channel_id = video_channel.channel_link.split("/")[-1]
|
||||
uri = URI('https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=' + channel_id + '&key=AIzaSyCTFdyLgb7GJfrr1JOI3gvVslZFw7td2zQ')
|
||||
result = Net::HTTP.get(uri) # => String
|
||||
result = JSON.parse(result)
|
||||
result.each do |video_channel|
|
||||
nextPageToken = result['nextPageToken'] rescue ""
|
||||
while !nextPageToken.nil?
|
||||
vc << {
|
||||
|
|
|
@ -13,4 +13,7 @@ class VideoChannel
|
|||
field :channel_link
|
||||
field :description , localize: true
|
||||
|
||||
def self.find_by_param(input)
|
||||
self.find_by(uid: input)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue