Framework and aprroach to get youtube read data using ruby

I need to get user, channel and video data (views, ratings, subscribers, etc.) from youtube using ruby.

which tool / gem / framework to use:

I know this has been asked before, but it is specific to my problem, I do not want to upload videos, etc., most frameworks seem to be adapted to this.

None of them seem to suit me very much, should I use httparty and flip my own?

youtube-model - http://github.com/edgarjs/youtube-model/tree/master

youtube-g - http://github.com/tmm1/youtube-g

gdata on rails - http://code.google.com/apis/gdata/articles/gdata_on_rails.html

which api to use?

Should I use this api: http://code.google.com/apis/youtube/2.0/developers_guide_protocol_insight.html

I need a list of videos before I can call it, I also need to find out which channel the user has, ideally get the penetration data at the channel level if I can’t fill it.

Or there are channels: http://code.google.com/apis/youtube/2.0/developers_guide_protocol_understanding_video_feeds.html

the best way to get such data.

+3
source share
1 answer

I spent some time working on it on the weekend. Youtube-Model seems to work best:

  • Use an example in the youtube model to get an authsub token

     yt = YouTubeAccess.uploaded_by_user(token)
     yt_videos = yt.videos
       yt_videos.each{|video|
          view_count = video.statistics.viewCount.to_i
          favorite_count = video.statistics.favoriteCount.to_i
          comment_count = video.comments.attributes['feedLink'].countHint.to_i
       }
    

, , .

0

Source: https://habr.com/ru/post/1760825/


All Articles