youtube_it 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ea702383572e46712f8190745fb3e5c6bbb6aab7
4
+ data.tar.gz: d5626b52a4466bbc666ccb929183224da5a7040f
5
+ SHA512:
6
+ metadata.gz: dd6266ca7d7fadd0e61548b6d3ee47dff4ffedb0fddce584321c567d9b455e665330b60fd7bba4ad0889cabb200180bc20e2568f0a8dbc59dd25f4cb5dcf9e43
7
+ data.tar.gz: 83960eddcec401fcba13f5c49a5d1a7e374af49ba73ae547b5413f998eaf30c8248fc71609e908bdd6adbc2ef91cbc0193536933cf3d64a85cad1c64f70e3ad3
data/README.rdoc CHANGED
@@ -79,6 +79,7 @@ Basic Queries:
79
79
  $ client.videos_by(:query => "penguin")
80
80
  $ client.videos_by(:query => "penguin", :page => 2, :per_page => 15)
81
81
  $ client.videos_by(:query => "penguin", :restriction => "DE")
82
+ $ client.videos_by(:query => "penguin", :author => "liz")
82
83
  $ client.videos_by(:tags => ['tiger', 'leopard'])
83
84
  $ client.videos_by(:categories => [:news, :sports])
84
85
  $ client.videos_by(:categories => [:news, :sports], :tags => ['soccer', 'football'])
@@ -121,8 +122,8 @@ Fields Parameter(experimental features):
121
122
  $ client.videos_by(:fields => {:recorded => ((Date.today - 30)..(Date.today))})
122
123
 
123
124
  Note: These queries do not find private videos! Use these methods instead:
124
- $ client.get_my_video("FQK1URcxmb4")
125
- $ client.get_my_videos(:query => "penguin")
125
+ $ client.my_video("FQK1URcxmb4")
126
+ $ client.my_videos(:query => "penguin")
126
127
 
127
128
  == VIDEO MANAGEMENT
128
129
 
@@ -480,7 +480,7 @@ class YouTubeIt
480
480
 
481
481
  end
482
482
 
483
- class OAuth2Client < YouTubeIt::Client
483
+ class OAuth2Client < Client
484
484
  def initialize(options)
485
485
  @client_id = options[:client_id]
486
486
  @client_secret = options[:client_secret]
@@ -1,7 +1,7 @@
1
1
  class YouTubeIt
2
2
  module Model
3
3
  class Playlist < YouTubeIt::Record
4
- attr_reader :title, :description, :summary, :playlist_id, :xml, :published, :response_code
4
+ attr_reader :title, :description, :summary, :author, :videos_count, :playlist_id, :xml, :published, :response_code
5
5
  def videos
6
6
  YouTubeIt::Parser::VideosFeedParser.new(@xml).parse_videos
7
7
  end
@@ -9,6 +9,8 @@ class YouTubeIt
9
9
  # Describes the various file formats in which a Youtube video may be
10
10
  # made available and allows looking them up by format code number.
11
11
  class Format
12
+ attr_reader :format_code, :name
13
+
12
14
  @@formats = Hash.new
13
15
 
14
16
  # Instantiates a new video format object.
@@ -84,8 +84,10 @@ class YouTubeIt
84
84
  :title => entry.at("title") && entry.at("title").text,
85
85
  :summary => ((entry.at("summary") || entry.at_xpath("media:group").at_xpath("media:description")).text rescue nil),
86
86
  :description => ((entry.at("summary") || entry.at_xpath("media:group").at_xpath("media:description")).text rescue nil),
87
+ :author => (entry.at("author name").text rescue nil),
87
88
  :playlist_id => (entry.at("id").text[/playlist:([\w\-]+)/, 1] rescue nil),
88
89
  :published => entry.at("published") ? entry.at("published").text : nil,
90
+ :videos_count => (entry.at_xpath("openSearch:totalResults").text rescue nil),
89
91
  :response_code => content.status,
90
92
  :xml => content.body)
91
93
  end
@@ -231,7 +231,7 @@ class YouTubeIt
231
231
  reply_to = reply_to.unique_id if reply_to.is_a? YouTubeIt::Model::Comment
232
232
  comment_body = comment_xml_for(:comment => comment, :reply_to => reply_to_url(video_id, reply_to))
233
233
  comment_url = "/feeds/api/videos/%s/comments" % video_id
234
- response = yt_session.post(comment_url, comment_body)
234
+ response = yt_session(base_ssl_url).post(comment_url, comment_body)
235
235
  comment = YouTubeIt::Parser::CommentsFeedParser.new(response.body).parse_single_entry
236
236
  return {:code => response.status, :body => response.body, :comment => comment}
237
237
  end
@@ -239,7 +239,7 @@ class YouTubeIt
239
239
  def delete_comment(video_id, comment_id)
240
240
  comment_id = comment_id.unique_id if comment_id.is_a? YouTubeIt::Model::Comment
241
241
  url = "/feeds/api/videos/%s/comments/%s" % [video_id, comment_id]
242
- response = yt_session.delete(url)
242
+ response = yt_session(base_ssl_url).delete(url)
243
243
 
244
244
  return response.status == 200
245
245
  end
@@ -522,6 +522,10 @@ class YouTubeIt
522
522
  "http://gdata.youtube.com"
523
523
  end
524
524
 
525
+ def base_ssl_url
526
+ "https://gdata.youtube.com"
527
+ end
528
+
525
529
  def boundary
526
530
  "An43094fu"
527
531
  end
@@ -1,4 +1,4 @@
1
1
  class YouTubeIt
2
- VERSION = '2.4.0'
2
+ VERSION = '2.4.1'
3
3
  end
4
4
 
data/youtube_it.gemspec CHANGED
@@ -16,15 +16,14 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.add_runtime_dependency("nokogiri", "~> 1.6.0")
18
18
  s.add_runtime_dependency("oauth", "~> 0.4.4")
19
- s.add_runtime_dependency("oauth2", "~> 0.6")
19
+ s.add_runtime_dependency("oauth2", "~> 1.0.0")
20
20
  s.add_runtime_dependency("simple_oauth", ">= 0.1.5")
21
- s.add_runtime_dependency("faraday", "~> 0.8")
21
+ s.add_runtime_dependency("faraday", ['>= 0.8', '< 0.10'])
22
22
  s.add_runtime_dependency("builder", ">= 0")
23
- s.add_runtime_dependency("webmock")
24
23
  s.add_runtime_dependency("excon")
25
- s.add_runtime_dependency("json", "~> 1.7.7")
24
+ s.add_runtime_dependency("json", "~> 1.8")
25
+ s.add_development_dependency("webmock")
26
26
  s.files = Dir.glob("lib/**/*") + %w(README.rdoc youtube_it.gemspec)
27
27
 
28
28
  s.extra_rdoc_files = %w(README.rdoc CHANGELOG.md)
29
29
  end
30
-
metadata CHANGED
@@ -1,190 +1,214 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: youtube_it
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 2.4.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.4.1
6
5
  platform: ruby
7
- authors:
8
- - kylejginavan
9
- - chebyte
6
+ authors:
7
+ - kylejginavan
8
+ - chebyte
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
-
14
- date: 2013-11-15 00:00:00 Z
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: nokogiri
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
22
- - - ~>
23
- - !ruby/object:Gem::Version
24
- version: 1.6.0
25
- type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: oauth
29
- prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
31
- none: false
32
- requirements:
33
- - - ~>
34
- - !ruby/object:Gem::Version
35
- version: 0.4.4
36
- type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: oauth2
40
- prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ~>
45
- - !ruby/object:Gem::Version
46
- version: "0.6"
47
- type: :runtime
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: simple_oauth
51
- prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: 0.1.5
58
- type: :runtime
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
61
- name: faraday
62
- prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
64
- none: false
65
- requirements:
66
- - - ~>
67
- - !ruby/object:Gem::Version
68
- version: "0.8"
69
- type: :runtime
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
72
- name: builder
73
- prerelease: false
74
- requirement: &id006 !ruby/object:Gem::Requirement
75
- none: false
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- version: "0"
80
- type: :runtime
81
- version_requirements: *id006
82
- - !ruby/object:Gem::Dependency
83
- name: webmock
84
- prerelease: false
85
- requirement: &id007 !ruby/object:Gem::Requirement
86
- none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: "0"
91
- type: :runtime
92
- version_requirements: *id007
93
- - !ruby/object:Gem::Dependency
94
- name: excon
95
- prerelease: false
96
- requirement: &id008 !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: "0"
102
- type: :runtime
103
- version_requirements: *id008
104
- - !ruby/object:Gem::Dependency
105
- name: json
106
- prerelease: false
107
- requirement: &id009 !ruby/object:Gem::Requirement
108
- none: false
109
- requirements:
110
- - - ~>
111
- - !ruby/object:Gem::Version
112
- version: 1.7.7
113
- type: :runtime
114
- version_requirements: *id009
12
+ date: 2014-07-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: nokogiri
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: 1.6.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ version: 1.6.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: oauth
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: 0.4.4
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: 0.4.4
42
+ - !ruby/object:Gem::Dependency
43
+ name: oauth2
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ~>
47
+ - !ruby/object:Gem::Version
48
+ version: 1.0.0
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: 1.0.0
56
+ - !ruby/object:Gem::Dependency
57
+ name: simple_oauth
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: 0.1.5
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: 0.1.5
70
+ - !ruby/object:Gem::Dependency
71
+ name: faraday
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0.8'
77
+ - - <
78
+ - !ruby/object:Gem::Version
79
+ version: '0.10'
80
+ type: :runtime
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0.8'
87
+ - - <
88
+ - !ruby/object:Gem::Version
89
+ version: '0.10'
90
+ - !ruby/object:Gem::Dependency
91
+ name: builder
92
+ requirement: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ type: :runtime
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ - !ruby/object:Gem::Dependency
105
+ name: excon
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ type: :runtime
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ - !ruby/object:Gem::Dependency
119
+ name: json
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '1.8'
125
+ type: :runtime
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ~>
130
+ - !ruby/object:Gem::Version
131
+ version: '1.8'
132
+ - !ruby/object:Gem::Dependency
133
+ name: webmock
134
+ requirement: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ type: :development
140
+ prerelease: false
141
+ version_requirements: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
115
146
  description: Upload, delete, update, comment on youtube videos all from one gem.
116
- email:
117
- - kylejginavan@gmail.com
118
- - maurotorres@gmail.com
147
+ email:
148
+ - kylejginavan@gmail.com
149
+ - maurotorres@gmail.com
119
150
  executables: []
120
-
121
151
  extensions: []
122
-
123
- extra_rdoc_files:
124
- - README.rdoc
125
- - CHANGELOG.md
126
- files:
127
- - lib/youtube_it.rb
128
- - lib/youtube_it/chain_io.rb
129
- - lib/youtube_it/client.rb
130
- - lib/youtube_it/parser.rb
131
- - lib/youtube_it/record.rb
132
- - lib/youtube_it/version.rb
133
- - lib/youtube_it/middleware/faraday_authheader.rb
134
- - lib/youtube_it/middleware/faraday_oauth.rb
135
- - lib/youtube_it/middleware/faraday_oauth2.rb
136
- - lib/youtube_it/middleware/faraday_youtubeit.rb
137
- - lib/youtube_it/model/activity.rb
138
- - lib/youtube_it/model/author.rb
139
- - lib/youtube_it/model/caption.rb
140
- - lib/youtube_it/model/category.rb
141
- - lib/youtube_it/model/comment.rb
142
- - lib/youtube_it/model/contact.rb
143
- - lib/youtube_it/model/content.rb
144
- - lib/youtube_it/model/message.rb
145
- - lib/youtube_it/model/playlist.rb
146
- - lib/youtube_it/model/rating.rb
147
- - lib/youtube_it/model/subscription.rb
148
- - lib/youtube_it/model/thumbnail.rb
149
- - lib/youtube_it/model/user.rb
150
- - lib/youtube_it/model/video.rb
151
- - lib/youtube_it/request/base_search.rb
152
- - lib/youtube_it/request/error.rb
153
- - lib/youtube_it/request/remote_file.rb
154
- - lib/youtube_it/request/standard_search.rb
155
- - lib/youtube_it/request/user_search.rb
156
- - lib/youtube_it/request/video_search.rb
157
- - lib/youtube_it/request/video_upload.rb
158
- - lib/youtube_it/response/video_search.rb
159
- - README.rdoc
160
- - youtube_it.gemspec
161
- - CHANGELOG.md
152
+ extra_rdoc_files:
153
+ - README.rdoc
154
+ - CHANGELOG.md
155
+ files:
156
+ - lib/youtube_it/chain_io.rb
157
+ - lib/youtube_it/client.rb
158
+ - lib/youtube_it/middleware/faraday_authheader.rb
159
+ - lib/youtube_it/middleware/faraday_oauth.rb
160
+ - lib/youtube_it/middleware/faraday_oauth2.rb
161
+ - lib/youtube_it/middleware/faraday_youtubeit.rb
162
+ - lib/youtube_it/model/activity.rb
163
+ - lib/youtube_it/model/author.rb
164
+ - lib/youtube_it/model/caption.rb
165
+ - lib/youtube_it/model/category.rb
166
+ - lib/youtube_it/model/comment.rb
167
+ - lib/youtube_it/model/contact.rb
168
+ - lib/youtube_it/model/content.rb
169
+ - lib/youtube_it/model/message.rb
170
+ - lib/youtube_it/model/playlist.rb
171
+ - lib/youtube_it/model/rating.rb
172
+ - lib/youtube_it/model/subscription.rb
173
+ - lib/youtube_it/model/thumbnail.rb
174
+ - lib/youtube_it/model/user.rb
175
+ - lib/youtube_it/model/video.rb
176
+ - lib/youtube_it/parser.rb
177
+ - lib/youtube_it/record.rb
178
+ - lib/youtube_it/request/base_search.rb
179
+ - lib/youtube_it/request/error.rb
180
+ - lib/youtube_it/request/remote_file.rb
181
+ - lib/youtube_it/request/standard_search.rb
182
+ - lib/youtube_it/request/user_search.rb
183
+ - lib/youtube_it/request/video_search.rb
184
+ - lib/youtube_it/request/video_upload.rb
185
+ - lib/youtube_it/response/video_search.rb
186
+ - lib/youtube_it/version.rb
187
+ - lib/youtube_it.rb
188
+ - README.rdoc
189
+ - youtube_it.gemspec
190
+ - CHANGELOG.md
162
191
  homepage: http://github.com/kylejginavan/youtube_it
163
192
  licenses: []
164
-
193
+ metadata: {}
165
194
  post_install_message:
166
195
  rdoc_options: []
167
-
168
- require_paths:
169
- - lib
170
- required_ruby_version: !ruby/object:Gem::Requirement
171
- none: false
172
- requirements:
173
- - - ">="
174
- - !ruby/object:Gem::Version
175
- version: "0"
176
- required_rubygems_version: !ruby/object:Gem::Requirement
177
- none: false
178
- requirements:
179
- - - ">="
180
- - !ruby/object:Gem::Version
181
- version: "0"
196
+ require_paths:
197
+ - lib
198
+ required_ruby_version: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - '>='
201
+ - !ruby/object:Gem::Version
202
+ version: '0'
203
+ required_rubygems_version: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - '>='
206
+ - !ruby/object:Gem::Version
207
+ version: '0'
182
208
  requirements: []
183
-
184
209
  rubyforge_project:
185
- rubygems_version: 1.8.15
210
+ rubygems_version: 2.0.14
186
211
  signing_key:
187
- specification_version: 3
212
+ specification_version: 4
188
213
  summary: The most complete Ruby wrapper for youtube api's
189
214
  test_files: []
190
-