youtube_api 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a321773a5ede3a76d324e138c8a85912d23edc88
4
+ data.tar.gz: bdc6c088b3570270f75464c84e1c776fafaef948
5
+ SHA512:
6
+ metadata.gz: 0db1d30f670fe0c67f51eb50b376d8d428ba3f25fad34bc2e392d944b93b5c1b677c9a1ec2d7d978d00ee5221d5f78192923affe1aa870d0f36180b258a62384
7
+ data.tar.gz: 719e9ad25d829c0e73815b8c64329721e81d5482b52e09dc360bd0c136b87e7a437e043c152aed7cb4fa3edc9a6d9697e37ffac2240bbb7cbabfb84184e8c4e3
File without changes
@@ -0,0 +1,36 @@
1
+ require 'google/api_client'
2
+
3
+ module YouTubeApi
4
+
5
+ class Query
6
+
7
+ def initialize(options={})
8
+
9
+ options = {
10
+ :youtube_api_service_name => "youtube",
11
+ :youtube_api_version => "v3"
12
+ }.merge(options)
13
+
14
+ @client = Google::APIClient.new(:key => options[:api_key], :authorization => nil) #Please provide :application_name and :application_version when initializing the client
15
+ @youtube = @client.discovered_api(options[:youtube_api_service_name], options[:youtube_api_version])
16
+
17
+ end
18
+
19
+ def query(options={})
20
+
21
+ options = {
22
+ :part => 'id,snippet'
23
+ }.merge(options)
24
+
25
+ search_response = @client.execute!(
26
+ :api_method => @youtube.search.list,
27
+ :parameters => options
28
+ )
29
+
30
+ return search_response.data.items
31
+
32
+ end
33
+
34
+ end
35
+
36
+ end
@@ -0,0 +1,12 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "youtube_api"
3
+ s.version = "0.0.0"
4
+ s.summary = "Gem for searching YouTube videos"
5
+ s.description = "Searches for videos on YouTube using YouTube API v3"
6
+ s.email = "martynbissett@yahoo.co.uk"
7
+ s.authors = ["Martyn Bissett"]
8
+ s.homepage = "https://github.com/martynbiz/youtube_api"
9
+ s.license = "MIT"
10
+ s.files = ["lib/youtube_api.rb", "README.md", "youtube_api.gemspec"]
11
+ s.add_runtime_dependency "google-api-client", ["~> 0.7.1"]
12
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: youtube_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Martyn Bissett
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-api-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 0.7.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.7.1
27
+ description: Searches for videos on YouTube using YouTube API v3
28
+ email: martynbissett@yahoo.co.uk
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/youtube_api.rb
34
+ - README.md
35
+ - youtube_api.gemspec
36
+ homepage: https://github.com/martynbiz/youtube_api
37
+ licenses:
38
+ - MIT
39
+ metadata: {}
40
+ post_install_message:
41
+ rdoc_options: []
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirements: []
55
+ rubyforge_project:
56
+ rubygems_version: 2.1.9
57
+ signing_key:
58
+ specification_version: 4
59
+ summary: Gem for searching YouTube videos
60
+ test_files: []