ruboty-youtube 0.2.0 → 0.2.1

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: 1aa78fe2e84056fbfd105a91c11c74f77545c0ba
4
- data.tar.gz: 0fa67331fd1b867a40d91d1de05c894a335755d8
3
+ metadata.gz: 9d46ea0b0bed1c945769613484e04633aeb0dc62
4
+ data.tar.gz: dbd26c4376260c0d5e795f33318894cba49f0c21
5
5
  SHA512:
6
- metadata.gz: cb027275ed4ae4d04c5bb0fd7ce18b8c5f9a57d5f89e1bfad8790790917af01f7952a9c74662ecdf8ddafd06fbcb230d2bb3f9f8f5a9cc0991d9dd7789188f39
7
- data.tar.gz: 0eb3fb79d8dae12cace2210b5c2ff7cd448e765e579530f888d7a79d0fe80f8baa64a3b719a960e42f460805137b28cac5677d684bbbc200085ff31adff011a7
6
+ metadata.gz: ba47cddfb48053e29e48a518176f3fe71ba1e258b1177bcc70c274fd2abb94186610fc778ee978813999d0474fd90a5b7d1d8a2d0690d563900f4a5e8ed04956
7
+ data.tar.gz: 97e91dcb45c239c64ceb7beea49c410d29fcec3709b786a06093eebf83c626d2a628691004a14f5dd6dbab07c09d6e5ac481cc2f6d0942075889f500239c25bc
@@ -7,15 +7,15 @@ module Ruboty
7
7
  result =
8
8
  if message[:target]
9
9
  Ruboty::Youtube::Client.new(
10
- message[:keyword],
10
+ message[:target].to_sym,
11
11
  message[:mode].to_sym,
12
- message[:target].to_sym
12
+ message[:keyword]
13
13
  ).search
14
14
  else
15
15
  Ruboty::Youtube::Client.new(
16
- message[:keyword],
16
+ :video,
17
17
  message[:mode].to_sym,
18
- :video
18
+ message[:keyword]
19
19
  ).search
20
20
  end
21
21
 
@@ -8,14 +8,14 @@ module Ruboty
8
8
  class Client
9
9
  YOUTUBE_URL = 'https://www.youtube.com'
10
10
 
11
- def initialize(query, mode, target)
11
+ def initialize(target, mode, query)
12
12
  @conn = Faraday.new(url: YOUTUBE_URL, ssl: { verify: false }) do |faraday|
13
13
  faraday.request :url_encoded
14
14
  faraday.adapter Faraday.default_adapter
15
15
  end
16
- @query = query
17
- @mode = mode
18
16
  @target = target
17
+ @mode = mode
18
+ @query = query
19
19
  end
20
20
 
21
21
  def search
@@ -38,7 +38,7 @@ module Ruboty
38
38
  case @mode
39
39
  when :top
40
40
  YOUTUBE_URL + result.first
41
- when:rand
41
+ when :rand
42
42
  YOUTUBE_URL + result.sample
43
43
  end
44
44
  end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Youtube
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-youtube
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaihar4