muzang-plugins 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,24 +1,25 @@
1
1
  require "em-http-request"
2
2
  require "json"
3
3
  require "memetron"
4
+ require "soup-client"
4
5
 
5
6
  class Meme
6
7
  include Muzang::Plugins::Helpers
7
8
 
8
-
9
-
10
9
  MEMES = {
11
10
  dos_equis: { image_id: 2485, generator: 74 },
12
11
  y_u_no?: { image_id: 166088, generator: 2 },
13
12
  bear_grylls: { image_id: 89714, generator: 92 },
14
13
  fry: { image_id: 84688, generator: 305 },
15
14
  orly: { image_id: 117049, generator: 920 },
16
- all: { image_id: 1121885, generator: 6013 }
15
+ all: { image_id: 1121885, generator: 6013 },
16
+ obama: { image_id: 2154021, generator: 372781 }
17
17
  }
18
18
 
19
19
  def initialize(bot)
20
20
  @bot = bot
21
21
  @matcher = Memetron::Matcher.new
22
+ @soup = File.open(ENV["HOME"] + "/.muzang/" + "soup").read.split(":") rescue nil
22
23
  end
23
24
 
24
25
  def call(connection, message)
@@ -64,6 +65,9 @@ class Meme
64
65
  when :all
65
66
  @text0 = meme[1][0]
66
67
  @text1 = "all the things!"
68
+ when :obama
69
+ @text0 = meme[1][0]
70
+ @text1 = "not bad"
67
71
  else
68
72
  @text0 = meme[1][0]
69
73
  @text1 = meme[1][1]
@@ -87,6 +91,11 @@ class Meme
87
91
  meme = JSON.parse(http.response)
88
92
  url = "http://version1.api.memegenerator.net#{meme['result']['instanceImageUrl']}"
89
93
  connection.msg("#{@bot.channels.first}", "Meme: #{url}")
94
+ if @soup
95
+ soup = Soup::Client.new(@soup.first, @soup.last.chomp)
96
+ soup.login
97
+ soup.new_image(url)
98
+ end
90
99
  }
91
100
  end
92
101
  end
@@ -1,5 +1,5 @@
1
1
  module Muzang
2
2
  module Plugins
3
- VERSION = "1.1.2"
3
+ VERSION = "1.1.3"
4
4
  end
5
5
  end
@@ -18,6 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.add_dependency "em-http-request"
19
19
  gem.add_dependency "muzang", "~> 1.0.0"
20
20
  gem.add_dependency "memetron", "~> 0.1.1"
21
+ gem.add_dependency "soup-client"
21
22
 
22
23
  gem.add_development_dependency "em-ventually", "~> 0.1.2"
23
24
  gem.add_development_dependency "rspec", "~> 2.6.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muzang-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-22 00:00:00.000000000 Z
12
+ date: 2012-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: em-http-request
16
- requirement: &23409700 !ruby/object:Gem::Requirement
16
+ requirement: &27846340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *23409700
24
+ version_requirements: *27846340
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: muzang
27
- requirement: &23409200 !ruby/object:Gem::Requirement
27
+ requirement: &27845320 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *23409200
35
+ version_requirements: *27845320
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: memetron
38
- requirement: &23425080 !ruby/object:Gem::Requirement
38
+ requirement: &27860080 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,21 @@ dependencies:
43
43
  version: 0.1.1
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *23425080
46
+ version_requirements: *27860080
47
+ - !ruby/object:Gem::Dependency
48
+ name: soup-client
49
+ requirement: &27858960 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *27858960
47
58
  - !ruby/object:Gem::Dependency
48
59
  name: em-ventually
49
- requirement: &23424620 !ruby/object:Gem::Requirement
60
+ requirement: &27856260 !ruby/object:Gem::Requirement
50
61
  none: false
51
62
  requirements:
52
63
  - - ~>
@@ -54,10 +65,10 @@ dependencies:
54
65
  version: 0.1.2
55
66
  type: :development
56
67
  prerelease: false
57
- version_requirements: *23424620
68
+ version_requirements: *27856260
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: rspec
60
- requirement: &23424160 !ruby/object:Gem::Requirement
71
+ requirement: &27855220 !ruby/object:Gem::Requirement
61
72
  none: false
62
73
  requirements:
63
74
  - - ~>
@@ -65,10 +76,10 @@ dependencies:
65
76
  version: 2.6.0
66
77
  type: :development
67
78
  prerelease: false
68
- version_requirements: *23424160
79
+ version_requirements: *27855220
69
80
  - !ruby/object:Gem::Dependency
70
81
  name: rake
71
- requirement: &23423780 !ruby/object:Gem::Requirement
82
+ requirement: &27854040 !ruby/object:Gem::Requirement
72
83
  none: false
73
84
  requirements:
74
85
  - - ! '>='
@@ -76,7 +87,7 @@ dependencies:
76
87
  version: '0'
77
88
  type: :development
78
89
  prerelease: false
79
- version_requirements: *23423780
90
+ version_requirements: *27854040
80
91
  description: Plugins for Muzang IRC bot
81
92
  email:
82
93
  - piotr.nielacny@gmail.com
@@ -279,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
290
  version: '0'
280
291
  requirements: []
281
292
  rubyforge_project:
282
- rubygems_version: 1.8.10
293
+ rubygems_version: 1.8.15
283
294
  signing_key:
284
295
  specification_version: 3
285
296
  summary: Basic plugins for Muzang IRC bot