ruboty-youtube 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruboty/youtube/client.rb +4 -4
- data/lib/ruboty/youtube/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6baf2b6a33b2011161c979c26ab9e32279d0c9da
|
4
|
+
data.tar.gz: 9ba02989a437ca4017ef6e570ed2a9022e69b2de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6bb77c8fc21d07dfe4e7fcfef6f1aef4f928cf304ed92ed2402c610d0b1d4e64c32b847748e2b6282c48b3020838cb103808741e0942347f25ca4dfeae9518a
|
7
|
+
data.tar.gz: 2fcc8d48f8ba7b309398e47668db4b5b86c92f573a7aa17cd1debbbf21abc980a82aadbc29f73093214004772d8dccfe8fd2714b168544d96a3f3a4e918a0f93
|
@@ -31,9 +31,9 @@ module Ruboty
|
|
31
31
|
|
32
32
|
def parse_response(response)
|
33
33
|
video_links = Nokogiri::HTML(response).css('.yt-lockup-thumbnail a')
|
34
|
-
result = video_links.each_with_object([])
|
34
|
+
result = video_links.each_with_object([]) {|video_link, array|
|
35
35
|
array << video_link.attribute('href').content
|
36
|
-
|
36
|
+
}.select {|link| link.start_with?('/watch') }
|
37
37
|
|
38
38
|
case @mode
|
39
39
|
when :top
|
@@ -48,7 +48,7 @@ module Ruboty
|
|
48
48
|
search_query: @query
|
49
49
|
}
|
50
50
|
|
51
|
-
|
51
|
+
append_params =
|
52
52
|
case @target
|
53
53
|
when :video
|
54
54
|
{
|
@@ -60,7 +60,7 @@ module Ruboty
|
|
60
60
|
}
|
61
61
|
end
|
62
62
|
|
63
|
-
default_params.merge(
|
63
|
+
default_params.merge(append_params)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty-youtube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kaihar4
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruboty
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.5.1
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Ruboty handler to search from YouTube
|