Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: thibaudgg/video_info
base: master
...
head fork: alg/video_info
compare: master
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 25, 2011
@alg alg Added author support to Youtube ed35f7d
View
2  lib/provider/vimeo.rb
@@ -5,7 +5,7 @@ class Vimeo
attr_accessor :video_id, :url, :provider, :title, :description, :keywords,
:duration, :date, :width, :height,
:thumbnail_small, :thumbnail_large,
- :view_count
+ :view_count, :author
def initialize(url)
@video_id = url.gsub(/.*\.com\/([0-9]+).*$/i, '\1')
View
3  lib/provider/youtube.rb
@@ -5,7 +5,7 @@ class Youtube
attr_accessor :video_id, :url, :provider, :title, :description, :keywords,
:duration, :date, :width, :height,
:thumbnail_small, :thumbnail_large,
- :view_count
+ :view_count, :author
def initialize(url)
@video_id = url.gsub(/.*v=([^&]+).*$/i, '\1')
@@ -25,6 +25,7 @@ def get_info
@date = Time.parse(doc.search("published").inner_text, Time.now.utc)
@thumbnail_small = doc.search("media:thumbnail").min { |a,b| a[:height].to_i * a[:width].to_i <=> b[:height].to_i * b[:width].to_i }[:url]
@thumbnail_large = doc.search("media:thumbnail").max { |a,b| a[:height].to_i * a[:width].to_i <=> b[:height].to_i * b[:width].to_i }[:url]
+ @author = doc.search("author name").inner_text
# when your video still has no view, yt:statistics is not returned by Youtube
# see: https://github.com/thibaudgg/video_info/issues#issue/2
if doc.search("yt:statistics").first
View
4 video_info.gemspec
@@ -3,10 +3,10 @@ $:.push File.expand_path("../lib", __FILE__)
require "video_info/version"
Gem::Specification.new do |s|
- s.name = "video_info"
+ s.name = "alg-video_info"
s.version = VideoInfoVersion::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ['Thibaud Guillaume-Gentil']
+ s.authors = ['Thibaud Guillaume-Gentil', 'Aleksey Gureiev']
s.email = ['thibaud@thibaud.me']
s.homepage = 'http://rubygems.org/gems/video_info'
s.summary = 'Vimeo & Youtube parser'

No commit comments for this range

Something went wrong with that request. Please try again.