cogbot 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +9 -9
- data/README.md +14 -1
- data/lib/cogbot/setup.rb +1 -1
- data/lib/cogbot/version.rb +1 -1
- data/plugins/manager.rb +1 -1
- data/plugins/tweet.rb +18 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e507f5555aea13239fa0c558da83b0adaff0769c
|
4
|
+
data.tar.gz: bcb41ab67f0dec2678ab884d5eff810907afbf94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad328acddaf1f81bed239d03e5c1f7d052a820ec1569ca2092ff0f6512b7201bba96eb35c5c27a8e207fff2e7ddae05bf9a3846961ac04dff8da5df1a1360d02
|
7
|
+
data.tar.gz: a8604ada50f361692af7a5f097f2564e0f4f4cf552e2a018f1213acb63411aa6d4c852033e373626e1d21c9acd865e80412a90d5e172cbf825c379d496d5a1db
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
Cogbot Changelog
|
2
2
|
===================
|
3
3
|
|
4
|
+
## v0.1.1 - 2015-01-28
|
5
|
+
- avoid disclose local path in nmanager plugin when plugin not found
|
6
|
+
- fix setup message config.yaml to cogbot.yaml
|
7
|
+
|
4
8
|
## v0.1.0 - 2015-01-08
|
5
9
|
- upgrade dependency to cinch 2.0.6 to 2.2.2
|
6
10
|
- upgrade other gems as well
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cogbot (0.1.
|
4
|
+
cogbot (0.1.1)
|
5
5
|
cinch (~> 2.2.2)
|
6
6
|
daemons (~> 1.1.9)
|
7
7
|
eventmachine (~> 1.0.4)
|
@@ -19,43 +19,43 @@ GEM
|
|
19
19
|
addressable (2.3.6)
|
20
20
|
awesome_print (1.6.1)
|
21
21
|
buftok (0.2.0)
|
22
|
-
cinch (2.2.
|
22
|
+
cinch (2.2.3)
|
23
23
|
coderay (1.1.0)
|
24
24
|
daemons (1.1.9)
|
25
25
|
docile (1.1.5)
|
26
26
|
equalizer (0.0.9)
|
27
27
|
eventmachine (1.0.4)
|
28
28
|
eventmachine_httpserver (0.2.1)
|
29
|
-
faraday (0.9.
|
29
|
+
faraday (0.9.1)
|
30
30
|
multipart-post (>= 1.2, < 3)
|
31
|
-
flog (4.3.
|
31
|
+
flog (4.3.1)
|
32
32
|
ruby_parser (~> 3.1, > 3.1.0)
|
33
33
|
sexp_processor (~> 4.4)
|
34
34
|
fortune_gem (0.0.8)
|
35
35
|
http (0.6.3)
|
36
36
|
http_parser.rb (~> 0.6.0)
|
37
37
|
http_parser.rb (0.6.0)
|
38
|
-
json (1.8.
|
38
|
+
json (1.8.2)
|
39
39
|
memoizable (0.4.2)
|
40
40
|
thread_safe (~> 0.3, >= 0.3.1)
|
41
41
|
method_source (0.8.2)
|
42
42
|
mini_portile (0.6.2)
|
43
|
-
minitest (5.5.
|
43
|
+
minitest (5.5.1)
|
44
44
|
minitest-ci (3.0.3)
|
45
45
|
minitest (~> 5.0, >= 5.0.6)
|
46
46
|
multi_json (1.10.1)
|
47
47
|
multipart-post (2.0.0)
|
48
48
|
naught (1.0.0)
|
49
|
-
nokogiri (1.6.
|
49
|
+
nokogiri (1.6.6.2)
|
50
50
|
mini_portile (~> 0.6.0)
|
51
51
|
pry (0.10.1)
|
52
52
|
coderay (~> 1.1.0)
|
53
53
|
method_source (~> 0.8.1)
|
54
54
|
slop (~> 3.4)
|
55
55
|
rake (10.4.2)
|
56
|
-
ruby_parser (3.6.
|
56
|
+
ruby_parser (3.6.4)
|
57
57
|
sexp_processor (~> 4.1)
|
58
|
-
sexp_processor (4.4.
|
58
|
+
sexp_processor (4.4.5)
|
59
59
|
simple_oauth (0.3.1)
|
60
60
|
simplecov (0.9.1)
|
61
61
|
docile (~> 1.1.0)
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Cogbot
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/cogbot.svg)](http://badge.fury.io/rb/cogbot)
|
4
|
+
|
3
5
|
Cogbot is an irc bot written in ruby based on [Cinch bot framework](https://github.com/cinchrb/cinch).
|
4
6
|
|
5
7
|
It has been in service at [Code Green](http://codegreenit.com) from 2012 to 2013 and his stability
|
@@ -25,6 +27,17 @@ At first launch:
|
|
25
27
|
you will be prompted to create a configuration file in ~/.cogbot/cogbot.yml
|
26
28
|
When this is done you can launch again and it will just run according to your configuration.
|
27
29
|
|
30
|
+
## Development
|
31
|
+
|
32
|
+
git clone git@github.com:mose/cogbot.git
|
33
|
+
cd cogbot/
|
34
|
+
bundle install --path vendor
|
35
|
+
bundle exec ruby -Ilib bin/cogbot start
|
36
|
+
|
37
|
+
To reload plugins while developing, you can issue, on a channel where your bot is sitting:
|
38
|
+
|
39
|
+
.m reload myplugin
|
40
|
+
|
28
41
|
## Contributing
|
29
42
|
|
30
43
|
1. Fork it
|
@@ -42,4 +55,4 @@ When this is done you can launch again and it will just run according to your co
|
|
42
55
|
|
43
56
|
MIT license
|
44
57
|
|
45
|
-
Copyright (c) 2012-
|
58
|
+
Copyright (c) 2012-15 mose at mose
|
data/lib/cogbot/setup.rb
CHANGED
@@ -35,7 +35,7 @@ module Cogbot
|
|
35
35
|
default = YAML::load_file(File.join(ROOT_DIR,'config','cogbot.yml.defaults'))
|
36
36
|
main = {}
|
37
37
|
puts "You don't have a configuration file yet,"
|
38
|
-
puts "let's make one in ~/.cogbot/
|
38
|
+
puts "let's make one in ~/.cogbot/cogbot.yml"
|
39
39
|
puts
|
40
40
|
puts "Please answer those few questions"
|
41
41
|
|
data/lib/cogbot/version.rb
CHANGED
data/plugins/manager.rb
CHANGED
@@ -23,7 +23,7 @@ module Cinch
|
|
23
23
|
|
24
24
|
file_name = "#{ROOT_DIR}/plugins/#{mapping.downcase}.rb"
|
25
25
|
unless File.exist?(file_name)
|
26
|
-
m.reply "Could not load #{plugin} because #{file_name} does not exist."
|
26
|
+
m.reply "Could not load #{plugin} because #{File.basename(file_name)} does not exist."
|
27
27
|
return
|
28
28
|
end
|
29
29
|
|
data/plugins/tweet.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
+
# doc on https://github.com/sferik/twitter
|
2
|
+
# get tokens on https://apps.twitter.com
|
3
|
+
|
1
4
|
require 'twitter'
|
5
|
+
require 'awesome_print'
|
2
6
|
|
3
7
|
module Cinch
|
4
8
|
module Plugins
|
@@ -13,34 +17,36 @@ Tweet makes the bot can query twittter API
|
|
13
17
|
.t search <term> : searches the public timelines
|
14
18
|
EOT
|
15
19
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
def client
|
21
|
+
@_client ||= Twitter::REST::Client.new do |c|
|
22
|
+
c.consumer_key = @bot.config.options['cogconf']['tweet']['consumer_key']
|
23
|
+
c.consumer_secret = @bot.config.options['cogconf']['tweet']['consumer_secret']
|
24
|
+
c.access_token = @bot.config.options['cogconf']['tweet']['access_token']
|
25
|
+
c.access_token_secret = @bot.config.options['cogconf']['tweet']['access_token_secret']
|
26
|
+
end
|
27
|
+
end
|
24
28
|
|
25
29
|
def new(bot)
|
26
30
|
@bot = bot
|
27
31
|
end
|
28
32
|
|
29
|
-
def exec(command,args)
|
33
|
+
def exec(command, args)
|
30
34
|
back = ''
|
31
35
|
#back += "command: #{command} / args: #{args}\n"
|
32
36
|
begin
|
33
37
|
case command
|
34
38
|
when 'search'
|
35
|
-
|
36
|
-
back += status.
|
39
|
+
client.search(args).take(3).each do |status|
|
40
|
+
back += Format(:bold, :underline, :yellow, "@#{status.user.screen_name}") + " " + status.text + "\n"
|
37
41
|
end
|
38
42
|
else
|
39
|
-
back +=
|
43
|
+
back += "Usage: .t search <term> : searches the public timelines"
|
44
|
+
#back += Twitter.send(command,args.split(','))
|
40
45
|
end
|
41
46
|
rescue Exception => e
|
42
47
|
back += "Bad request\n"
|
43
48
|
back += e.inspect
|
49
|
+
back += e.backtrace.join("\n")
|
44
50
|
end
|
45
51
|
return back
|
46
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cogbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mose
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cinch
|