Class: YoutubePop::StandardApi

Inherits:
Object
  • Object
show all
Defined in:
lib/youtube_pop/standard_api.rb

Instance Method Summary collapse

Constructor Details

#initializeStandardApi

Returns a new instance of StandardApi.



18
19
20
21
22
23
24
25
26
27
# File 'lib/youtube_pop/standard_api.rb', line 18

def initialize
  options = {
    :timeout      => 2,
    :open_timeout => 2
  }
  @conn = Faraday.new(:url => 'https://gdata.youtube.com', :options => options) do |builder|
    builder.request  :url_encoded
    builder.adapter  :net_http
  end
end

Instance Method Details

#most_discussedObject



59
60
61
62
# File 'lib/youtube_pop/standard_api.rb', line 59

def most_discussed
  response = response_from url_for("most_discussed")
  get_entries(response)
end


49
50
51
52
# File 'lib/youtube_pop/standard_api.rb', line 49

def most_popular
  response = response_from url_for("most_popular")
  get_entries(response)
end

#most_recentObject



54
55
56
57
# File 'lib/youtube_pop/standard_api.rb', line 54

def most_recent
  response = response_from url_for("most_recent")
  get_entries(response)
end

#most_respondedObject



64
65
66
67
# File 'lib/youtube_pop/standard_api.rb', line 64

def most_responded
  response = response_from url_for("most_responded")
  get_entries(response)
end

#most_sharedObject



39
40
41
42
# File 'lib/youtube_pop/standard_api.rb', line 39

def most_shared
  response = response_from url_for("most_shared")
  get_entries(response)
end

#most_viewedObject



44
45
46
47
# File 'lib/youtube_pop/standard_api.rb', line 44

def most_viewed
  response = response_from url_for("most_viewed")
  get_entries(response)
end


69
70
71
72
# File 'lib/youtube_pop/standard_api.rb', line 69

def recently_featured
  response = response_from url_for("recently_featured")
  get_entries(response)
end

#top_favoritesObject



34
35
36
37
# File 'lib/youtube_pop/standard_api.rb', line 34

def top_favorites
  response = response_from url_for("top_favorites")
  get_entries(response)
end

#top_ratedObject



29
30
31
32
# File 'lib/youtube_pop/standard_api.rb', line 29

def top_rated
  response = response_from url_for("top_rated")
  get_entries(response)
end


74
75
76
77
# File 'lib/youtube_pop/standard_api.rb', line 74

def trending_videos
  response = response_from url_for("on_the_web")
  get_entries(response)
end