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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d46ea0b0bed1c945769613484e04633aeb0dc62
4
- data.tar.gz: dbd26c4376260c0d5e795f33318894cba49f0c21
3
+ metadata.gz: 6baf2b6a33b2011161c979c26ab9e32279d0c9da
4
+ data.tar.gz: 9ba02989a437ca4017ef6e570ed2a9022e69b2de
5
5
  SHA512:
6
- metadata.gz: ba47cddfb48053e29e48a518176f3fe71ba1e258b1177bcc70c274fd2abb94186610fc778ee978813999d0474fd90a5b7d1d8a2d0690d563900f4a5e8ed04956
7
- data.tar.gz: 97e91dcb45c239c64ceb7beea49c410d29fcec3709b786a06093eebf83c626d2a628691004a14f5dd6dbab07c09d6e5ac481cc2f6d0942075889f500239c25bc
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([]) do |video_link, array|
34
+ result = video_links.each_with_object([]) {|video_link, array|
35
35
  array << video_link.attribute('href').content
36
- end
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
- params =
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(params)
63
+ default_params.merge(append_params)
64
64
  end
65
65
  end
66
66
  end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Youtube
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
5
5
  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.1
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: 2015-05-16 00:00:00.000000000 Z
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.4.5
122
+ rubygems_version: 2.5.1
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Ruboty handler to search from YouTube