yourub 1.0.0 → 1.0.1

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.
data/Gemfile CHANGED
@@ -3,6 +3,3 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in yourub.gemspec
4
4
  gemspec
5
5
 
6
- # group :development, :test do
7
- # gem "byebug"
8
- # end
data/README.md CHANGED
@@ -32,10 +32,15 @@ If you are using rails, create a app/config/yourub.yml file as follow:
32
32
 
33
33
  ### Available parameters
34
34
  `:query` String, example `aliens`
35
+
35
36
  `:id` Sting, a valid youtube video id, example `NisCkxU544c`. If this parameter is set, tha others are ignored
37
+
36
38
  `:country` String, one or more alpha-2 country codes [ISO 3166-1](http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm), example `US` or `IT, DE`
39
+
37
40
  `:category` String, example `comedy`
41
+
38
42
  `:count_filters` Hash, example `{views: ">= 100"}` or `{views: "== 600"}`
43
+
39
44
  `:max_results` Integer, between 1 and 50
40
45
 
41
46
  It's necessary at least one of this parameters to start a search: `:country`, `:category`, `:query`, `:id`
@@ -75,7 +80,7 @@ client = Yourub::Client.new
75
80
  client.extended_info = true
76
81
  client.search(id: "NisCkxU544c")
77
82
  ```
78
- It will give you back much more information
83
+ It will give you much more information
79
84
  ```
80
85
  [{"kind"=>"youtube#video", "etag"=>"\"N5Eg36Gl054SUNiWWc-Su3t5O-k/U6AzLXvcnZt2WFqpnq9_dksV7DA\"", "id"=>"NisCkxU544c", "snippet"=>{"publishedAt"=>"2009-04-05T05:20:10.000Z", "channelId"=>"UCCHcEUksSVKsRDH86j77Ntg", "title"=>"Like A Boss (ft. Seth Rogen) - Uncensored Version", "description"=>"http://www.itunes.com/thelonelyisland\r\n\r\nThe new single from The Lonely Island's debut album \"INCREDIBAD\" In stores now!\r\n\r\nFeaturing Seth Rogen.\r\n\r\nThe Lonely Island is Andy Samberg, Akiva Schaffer & Jorma Taccone.", "thumbnails"=>{"default"=>{"url"=>"https://i1.ytimg.com/vi/NisCkxU544c/default.jpg", "width"=>120, "height"=>90}, "medium"=>{"url"=>"https://i1.ytimg.com/vi/NisCkxU544c/mqdefault.jpg", "width"=>320, "height"=>180}, "high"=>{"url"=>"https://i1.ytimg.com/vi/NisCkxU544c/hqdefault.jpg", "width"=>480, "height"=>360}, "standard"=>{"url"=>"https://i1.ytimg.com/vi/NisCkxU544c/sddefault.jpg", "width"=>640, "height"=>480}, "maxres"=>{"url"=>"https://i1.ytimg.com/vi/NisCkxU544c/maxresdefault.jpg", "width"=>1280, "height"=>720}}, "channelTitle"=>"thelonelyisland", "categoryId"=>"23", "liveBroadcastContent"=>"none"}, "statistics"=>{"viewCount"=>"120176425", "likeCount"=>"594592", "dislikeCount"=>"15121", "favoriteCount"=>"0", "commentCount"=>"208109"}}]
81
86
  ```
@@ -1,6 +1,6 @@
1
1
  module Yourub
2
2
  MAJOR = 1
3
3
  MINOR = 0
4
- PATCH = 0
4
+ PATCH = 1
5
5
  VERSION = [MAJOR, MINOR, PATCH].compact.join('.')
6
6
  end
data/yourub.gemspec CHANGED
@@ -9,9 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Davide Prati"]
10
10
  spec.email = ["lastexxit@gmail.com "]
11
11
  spec.description = %q{Youtube API v3 parser}
12
- spec.summary = %q{Yourub is a gem that fetch the most recent videos from
13
- the Youtube API for the given criteria}
14
- spec.homepage = ""
12
+ spec.summary = %q{Yourub is a gem that search videos on youtebe using the YouTube API v3}
13
+ spec.homepage = "http://edapx.com"
15
14
  spec.license = "MIT"
16
15
 
17
16
  spec.files = `git ls-files`.split($/)
@@ -20,10 +19,9 @@ Gem::Specification.new do |spec|
20
19
  spec.require_paths = ["lib"]
21
20
 
22
21
  spec.add_development_dependency "bundler", "~> 1.3"
23
- spec.add_development_dependency "rake"
24
- spec.add_development_dependency "byebug"
25
- spec.add_development_dependency "google-api-client"
22
+ spec.add_development_dependency "rake", "~> 10.1.0"
23
+ spec.add_development_dependency 'google-api-client', '~> 0.7.1'
26
24
 
27
25
  spec.add_development_dependency "rspec", "~> 2.14"
28
26
  spec.add_dependency "thor" , '~> 0.18'
29
- end
27
+ end
metadata CHANGED
@@ -1,112 +1,108 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yourub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Davide Prati
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-05-07 00:00:00.000000000 Z
12
+ date: 2014-05-08 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - "~>"
19
+ - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: '1.3'
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - "~>"
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.3'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - ">="
35
+ - - ~>
32
36
  - !ruby/object:Gem::Version
33
- version: '0'
37
+ version: 10.1.0
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - ">="
43
+ - - ~>
39
44
  - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: byebug
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
45
+ version: 10.1.0
55
46
  - !ruby/object:Gem::Dependency
56
47
  name: google-api-client
57
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
58
50
  requirements:
59
- - - ">="
51
+ - - ~>
60
52
  - !ruby/object:Gem::Version
61
- version: '0'
53
+ version: 0.7.1
62
54
  type: :development
63
55
  prerelease: false
64
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
65
58
  requirements:
66
- - - ">="
59
+ - - ~>
67
60
  - !ruby/object:Gem::Version
68
- version: '0'
61
+ version: 0.7.1
69
62
  - !ruby/object:Gem::Dependency
70
63
  name: rspec
71
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
72
66
  requirements:
73
- - - "~>"
67
+ - - ~>
74
68
  - !ruby/object:Gem::Version
75
69
  version: '2.14'
76
70
  type: :development
77
71
  prerelease: false
78
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
79
74
  requirements:
80
- - - "~>"
75
+ - - ~>
81
76
  - !ruby/object:Gem::Version
82
77
  version: '2.14'
83
78
  - !ruby/object:Gem::Dependency
84
79
  name: thor
85
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
86
82
  requirements:
87
- - - "~>"
83
+ - - ~>
88
84
  - !ruby/object:Gem::Version
89
85
  version: '0.18'
90
86
  type: :runtime
91
87
  prerelease: false
92
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
93
90
  requirements:
94
- - - "~>"
91
+ - - ~>
95
92
  - !ruby/object:Gem::Version
96
93
  version: '0.18'
97
94
  description: Youtube API v3 parser
98
95
  email:
99
- - 'lastexxit@gmail.com '
96
+ - ! 'lastexxit@gmail.com '
100
97
  executables:
101
98
  - yourub
102
99
  extensions: []
103
100
  extra_rdoc_files: []
104
101
  files:
105
- - ".gitignore"
102
+ - .gitignore
106
103
  - Gemfile
107
104
  - LICENSE.txt
108
105
  - README.md
109
- - README.md~
110
106
  - Rakefile
111
107
  - bin/yourub
112
108
  - config/yourub.yml
@@ -126,31 +122,31 @@ files:
126
122
  - spec/validator_spec.rb
127
123
  - yourub.gemspec
128
124
  - yourub.sublime-project
129
- homepage: ''
125
+ homepage: http://edapx.com
130
126
  licenses:
131
127
  - MIT
132
- metadata: {}
133
128
  post_install_message:
134
129
  rdoc_options: []
135
130
  require_paths:
136
131
  - lib
137
132
  required_ruby_version: !ruby/object:Gem::Requirement
133
+ none: false
138
134
  requirements:
139
- - - ">="
135
+ - - ! '>='
140
136
  - !ruby/object:Gem::Version
141
137
  version: '0'
142
138
  required_rubygems_version: !ruby/object:Gem::Requirement
139
+ none: false
143
140
  requirements:
144
- - - ">="
141
+ - - ! '>='
145
142
  - !ruby/object:Gem::Version
146
143
  version: '0'
147
144
  requirements: []
148
145
  rubyforge_project:
149
- rubygems_version: 2.2.0.rc.1
146
+ rubygems_version: 1.8.23
150
147
  signing_key:
151
- specification_version: 4
152
- summary: Yourub is a gem that fetch the most recent videos from the Youtube API for
153
- the given criteria
148
+ specification_version: 3
149
+ summary: Yourub is a gem that search videos on youtebe using the YouTube API v3
154
150
  test_files:
155
151
  - spec/client_spec.rb
156
152
  - spec/count_filter_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 62dceba4187f657c56c4257e6b8694ea3cda1d28
4
- data.tar.gz: e7b4c9de60739238e490380e6c0a94df15d25e73
5
- SHA512:
6
- metadata.gz: c83ec59e574c7d0fc9859a79bbf3035c81550461f01f93f4d6cd3be4184a5613974ac9f263ace49edb488007d11fdcc7954201437bc6bc08583fa78262fa7413
7
- data.tar.gz: 020afea31419fa548e7fb11725e3fbceb489014f5c1e75758564ff54da4bac80f63e8599afe2b9bcf2ae1b86a9cdf2e7e65d5f9876c9577761e238078ec4b8c8
data/README.md~ DELETED
@@ -1,91 +0,0 @@
1
- [![Code Climate](https://codeclimate.com/github/edap/yourub.png)](https://codeclimate.com/github/edap/yourub)
2
-
3
- # Yourub
4
- Yourub is a gem that search videos on youtebe using the YouTube API v3.
5
-
6
- ## Installation
7
-
8
- Add this line to your application's Gemfile:
9
-
10
- gem 'yourub'
11
-
12
- And then execute:
13
-
14
- $ bundle
15
-
16
- Or install it yourself as:
17
-
18
- $ gem install yourub
19
-
20
- ## Usage
21
-
22
- Get a developer key as explained [here](http://www.youtube.com/watch?v=Im69kzhpR3I)
23
- If you are using rails, create a app/config/yourub.yml file as follow:
24
-
25
- yourub:
26
- developer_key: 'yourdeveloperkey'
27
- youtube_api_service_name: 'youtube'
28
- youtube_api_version: 'v3'
29
- application_name: "nameofyourapp"
30
- application_version: "version_number_of_your_app"
31
- log_level: WARN
32
-
33
- ### Available parameters
34
- `:query` String, example `aliens`
35
- `:id` Sting, a valid youtube video id, example `NisCkxU544c`. If this parameter is set, tha others are ignored
36
- `:country` String, one or more alpha-2 country codes [ISO 3166-1](http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm), example `US` or `IT, DE`
37
- `:category` String, example `comedy`
38
- `:count_filters` Hash, example `{views: ">= 100"}` or `{views: "== 600"}`
39
- `:max_results` Integer, between 1 and 50
40
-
41
- It's necessary at least one of this parameters to start a search: `:country`, `:category`, `:query`, `:id`
42
-
43
- ### Examples
44
-
45
- For example, to find videos in the category "sports" in the country "de"
46
- ```ruby
47
- client = Yourub::Client.new
48
- client.search(country: "DE", category: "sports")
49
- client.videos
50
- ```
51
-
52
- To find video for a specific thema, use the parameter query
53
-
54
- ```ruby
55
- client = Yourub::Client.new
56
- client.search(query: "aliens")
57
- client.videos
58
- ```
59
-
60
- ### Extend Info
61
- As default Yourub will give you back few values, example:
62
-
63
- ```ruby
64
- client = Yourub::Client.new
65
- client.search(id: "mN0Dbj-xHY0")
66
- ```
67
- will report id, title, the default thumb, and the url where you can watch the video
68
- [{"id"=>"mN0Dbj-xHY0", "title"=>"GoPro: Hiero Day", "thumb"=>"https://i1.ytimg.com/vi/mN0Dbj-xHY0/default.jpg", "url"=>"https://www.youtube.com/watch?v=mN0Dbj-xHY0"}]
69
- ```
70
-
71
- To have more values back, use the option `extended_info`
72
- ```ruby
73
- client = Yourub::Client.new
74
- client.extended_info = true
75
- client.search(id: "NisCkxU544c")
76
- [{"kind"=>"youtube#video", "etag"=>"\"N5Eg36Gl054SUNiWWc-Su3t5O-k/U6AzLXvcnZt2WFqpnq9_dksV7DA\"", "id"=>"NisCkxU544c", "snippet"=>{"publishedAt"=>"2009-04-05T05:20:10.000Z", "channelId"=>"UCCHcEUksSVKsRDH86j77Ntg", "title"=>"Like A Boss (ft. Seth Rogen) - Uncensored Version", "description"=>"http://www.itunes.com/thelonelyisland\r\n\r\nThe new single from The Lonely Island's debut album \"INCREDIBAD\" In stores now!\r\n\r\nFeaturing Seth Rogen.\r\n\r\nThe Lonely Island is Andy Samberg, Akiva Schaffer & Jorma Taccone.", "thumbnails"=>{"default"=>{"url"=>"https://i1.ytimg.com/vi/NisCkxU544c/default.jpg", "width"=>120, "height"=>90}, "medium"=>{"url"=>"https://i1.ytimg.com/vi/NisCkxU544c/mqdefault.jpg", "width"=>320, "height"=>180}, "high"=>{"url"=>"https://i1.ytimg.com/vi/NisCkxU544c/hqdefault.jpg", "width"=>480, "height"=>360}, "standard"=>{"url"=>"https://i1.ytimg.com/vi/NisCkxU544c/sddefault.jpg", "width"=>640, "height"=>480}, "maxres"=>{"url"=>"https://i1.ytimg.com/vi/NisCkxU544c/maxresdefault.jpg", "width"=>1280, "height"=>720}}, "channelTitle"=>"thelonelyisland", "categoryId"=>"23", "liveBroadcastContent"=>"none"}, "statistics"=>{"viewCount"=>"120176425", "likeCount"=>"594592", "dislikeCount"=>"15121", "favoriteCount"=>"0", "commentCount"=>"208109"}}]
77
- ```
78
-
79
-
80
- ##TODO
81
-
82
- 1. adding a CLI
83
- 2. add `:order` in the search criteria
84
-
85
- ## Contributing
86
-
87
- 1. Fork it
88
- 2. Create your feature branch (`git checkout -b my-new-feature`)
89
- 3. Commit your changes (`git commit -am 'Add some feature'`)
90
- 4. Push to the branch (`git push origin my-new-feature`)
91
- 5. Create new Pull Request