views:

19

answers:

2

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

which tool/gem/framework to use:

I know this is asked before, but this is specific to my problem, I dont want to upload videos etc, most of the frameworks seem geared to this.

None of these seem to be a great fit to me, am I better off using httparty and rolling 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 this, also I need to figure out what channel the user has, ideally get insight data at the channel level, if not I can aggregate it.

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

a better way to get this kind of data.

A: 

mechanize + hpricot? -r

rogerdpack
A: 

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

  • Use example in youtube model to get 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
       }
    

Not sure how to do channels, but this is a good start.

Joelio