Robert Gerus
c6be66a6b1
Add tests for google, linktitle and nickserv.
2015-12-07 00:23:39 +01:00
Robert Gerus
b3bde638af
Add tests for :pick
2015-12-06 14:00:59 +01:00
Robert Gerus
6c413653aa
Don't always spoil the link contents with title.
2015-12-06 11:58:24 +01:00
Robert Gerus
f837889e2a
Missing copyright header.
2015-12-05 10:23:17 +01:00
Robert Gerus
24965d6756
Attempt to recode iso8859-2 title strings.
...
Fixes #25
2015-12-05 04:55:54 +01:00
Robert Gerus
8906d2ec86
Increase tls and http timeout.
...
It doesn't hurt us, because it's running in a goroutine anyway.
Fixes #26 .
2015-12-05 04:20:02 +01:00
Robert Gerus
a24f4bf592
Rename variables and fix a memleak.
...
You really shouldn't use single-letter variable names.
Also, it turns out that xpaths from gokogiri need to be freed.
2015-12-05 03:39:49 +01:00
Robert Gerus
9a406e0faf
Urldecode links returned from google search.
...
Fixes #24 .
2015-12-01 10:04:49 +01:00
Robert Gerus
355b702da6
Hopefully fix memleak in httpGet.
2015-11-29 21:16:47 +01:00
Robert Gerus
bbd552abab
Add jan plugin.
2015-11-29 21:10:38 +01:00
Robert Gerus
57c9e27977
Add "papiez" plugin.
2015-11-29 20:45:38 +01:00
Robert Gerus
f19d8bc78c
Add readLines helper.
...
It reads lines from file to []string slice.
2015-11-29 20:45:03 +01:00
Robert Gerus
3eabfde506
Add :pick plugin.
2015-11-29 19:44:31 +01:00
Robert Gerus
a4eda1468d
Update bonjour and cycki plugins.
2015-11-29 17:46:29 +01:00
Robert Gerus
7dee9b445f
Fix url building in bonjour.go
2015-11-29 17:14:40 +01:00
Robert Gerus
0d055fdb49
Fix cycki message.
2015-11-29 17:14:40 +01:00
Robert Gerus
32e7422459
Add proper cycki plugin.
2015-11-29 17:14:40 +01:00
Robert Gerus
57280448c2
Add cycki plugin.
2015-11-29 17:14:40 +01:00
Robert Gerus
dbe698ba3f
Add bonjour plugin.
2015-11-29 17:14:40 +01:00
Robert Gerus
f8cffdcd44
Fix tests for bot package.
2015-11-29 16:58:01 +01:00
Robert Gerus
bae1d8c427
Adjust bot package to changes in irc package.
...
Plugins work now. Tests don't, yet.
2015-11-29 15:50:31 +01:00
Robert Gerus
c5ec7e9c07
Add "google" plugin.
2015-11-25 14:56:59 +01:00
Robert Gerus
07a3b07e03
Check on demand if person is identified.
...
Works with freenode services. Might possibly crash somewhere else…
2015-11-23 19:16:35 +01:00
Robert Gerus
7b85c167f0
Preliminary version.
2015-11-23 17:53:08 +01:00
Robert Gerus
1cd5057bb0
Rounding to seconds makes more sense.
2015-11-22 11:53:13 +01:00
Robert Gerus
f3a6400620
Fix crash
2015-11-22 11:42:20 +01:00
Robert S. Gerus
aa54f36242
Merge pull request #12 from arachnist/seen
...
Add "seen" plugin.
2015-11-22 11:38:56 +01:00
Robert Gerus
449fbc99c5
Added formatting.
2015-11-22 11:34:28 +01:00
Robert Gerus
294fb3fdf8
Fix a crash in httpGetXpath()
...
doc, err := gokogiri.ParseHtml(buf) can leave both err and doc nil. Added a
check condition for that.
2015-11-22 01:59:57 +01:00
Robert Gerus
5692d3111a
Prefix "seen" messages.
2015-11-21 12:43:44 +01:00
Robert Gerus
3ef8b9aeca
Initial version of seen plugin.
...
Doesn't format the output yet, and has several other shortcomings.
2015-11-21 05:47:14 +01:00
Robert Gerus
771adfe1e6
Add json tag and rename field to silence golint.
2015-11-20 12:41:47 +01:00
Robert Gerus
9bec013fe7
Don't use bytes.Buffer when not needed.
2015-11-20 10:27:09 +01:00
Robert Gerus
970883081b
Trim characters prefixing urls.
2015-11-20 10:07:08 +01:00
Robert Gerus
f05a9e1e11
Silence golint and go vet, mostly.
2015-11-20 09:53:54 +01:00
Robert Gerus
1c19411c22
Don't post titles for things that don't have them.
2015-11-19 23:40:55 +01:00
Robert Gerus
9e5bac3e6f
Checkinator is now working correctly.
2015-11-19 22:39:24 +01:00
Robert Gerus
3418c0798d
Initial version of checkinator
2015-11-19 20:33:26 +01:00
Robert Gerus
11876334d9
Post kittens on :kotki
2015-11-19 18:47:47 +01:00
Robert Gerus
9f9dd527fe
Use reply helper in urltitle.go
2015-11-19 17:25:47 +01:00
Robert Gerus
0ad574b711
Add a reply helper to reduce code duplication.
2015-11-19 16:47:02 +01:00
Robert Gerus
57cd8ac5e7
Generalize http and xpath extraction functions.
2015-11-19 15:13:45 +01:00
Robert Gerus
4fea7a0116
Remove nasty chars.
2015-11-19 12:48:43 +01:00
Robert Gerus
7b7fae25ad
Try and try again.
2015-11-19 11:51:02 +01:00
Robert Gerus
4f11dcb03a
Prevent sending empty JOIN.
2015-11-19 11:46:39 +01:00
Robert Gerus
0cce9ec4d3
Partially works now.
...
Is now exploitable by titles with newlines…
2015-11-19 11:24:32 +01:00
Robert Gerus
863f8f1ba8
Urltitle plugin. Does not work yet, at all.
...
I guess the xpath is wrong.
```
goroutine 44 [running]:
github.com/arachnist/gorepost/bot.getUrlTitle(0xc82025b92f, 0x23, 0x0, 0x0)
/home/arachnist/gocode/src/github.com/arachnist/gorepost/bot/urltitle.go:63 +0x8e9
github.com/arachnist/gorepost/bot.linktitle(0xc820076660, 0xc820267cb0, 0xc820267c80, 0xc82025b917, 0x7, 0xc8202ca330, 0x1, 0x1, 0xc82025b92f,
0x23, ...)
/home/arachnist/gocode/src/github.com/arachnist/gorepost/bot/urltitle.go:80 +0x482
created by github.com/arachnist/gorepost/bot.Dispatcher
/home/arachnist/gocode/src/github.com/arachnist/gorepost/bot/dispatcher.go:55 +0x102b
```
2015-11-19 11:07:48 +01:00
Robert Gerus
058005a166
Join +i-only channels on identification.
2015-11-19 08:51:23 +01:00
Robert Gerus
9fb64a8088
Add nickserv plugin and test.
2015-11-19 08:24:07 +01:00
Robert Gerus
5045a61151
No need to respawn collector in loop.
...
Should make our tests less racy.
2015-11-19 08:21:06 +01:00
Robert Gerus
c8de32ddbf
Build tag is more important that copyright.
2015-11-19 02:23:03 +01:00
Robert Gerus
e199492be3
Apparently we do have io/ioutil
2015-11-18 19:37:25 +01:00
Robert Gerus
0672bd513f
Try and try again.
2015-11-18 19:24:59 +01:00
Robert Gerus
ceb938d8a3
Fix tests on go1.2
2015-11-18 19:20:50 +01:00
Robert Gerus
c98987577e
Silence needlessly verbose logs.
2015-11-18 19:12:54 +01:00
Robert Gerus
7a5f48784d
Fix Dispatcher()
...
It tried to look up things in WhitelistedPlugins despite it not being declared.
2015-11-18 16:51:10 +01:00
Robert Gerus
bbe1a3288a
Implement plugin whitelist.
...
Fixes #9 .
2015-11-18 16:24:30 +01:00
Robert Gerus
279be22965
Dispatcher now handles nonexisting keys.
2015-11-18 15:29:54 +01:00
Robert Gerus
e08994f0d2
Use config.LookupStringMap in bot.
2015-11-18 15:21:02 +01:00
Robert Gerus
f7cd422dae
Use new interfaces from config in bot.
2015-11-18 14:00:55 +01:00
Robert Gerus
3f3683dade
Replace reflect.DeepEqual with fmt.Sprintf("%+v")
...
Seems more predictable.
2015-11-18 11:28:18 +01:00
Robert Gerus
ada4ec7550
Fix imports for older Go.
2015-11-17 19:49:17 +01:00
Robert Gerus
67dbb69052
Try, and try again…
2015-11-17 19:46:48 +01:00
Robert Gerus
d7f6a4e865
Fix tests for go1.2, hopefully.
2015-11-17 19:38:42 +01:00
Robert Gerus
d069578cbc
That function is not needed anymore.
2015-11-17 18:50:38 +01:00
Robert Gerus
175aa6e79a
Add tests for bot package.
2015-11-17 18:44:52 +01:00
Robert Gerus
c0e212b8fb
Fix documentation after previous commit.
2015-11-17 15:11:15 +01:00
Robert Gerus
c160a8a362
Dispatcher does not need to be a goroutine.
...
This simplifies irc.Connection structure (removes quitdispatcher and output
channels), simplifies logic (no need to clean up those two channels and the
dispatcher goroutine) and will make testing bot dispatcher and plugins easier.
2015-11-17 14:34:30 +01:00
Robert Gerus
da032ba160
Brainfart
2015-11-16 20:27:43 +01:00
Robert Gerus
0598ee7a91
Fix godoc a bit.
2015-11-16 20:25:18 +01:00
Robert Gerus
6b6f7cd0c3
Documentation/comment/readme fixes here and there.
2015-11-12 12:55:51 +01:00
Robert Gerus
0703291209
Add copyright headers.
2015-11-12 10:07:53 +01:00
Robert Gerus
6876c0ff58
Add documentation in apropriate places
2015-11-12 09:30:12 +01:00
Robert Gerus
6c77cdf7f7
Code cleanup - do away with exports
2015-11-11 21:38:33 +01:00
Robert Gerus
3662108144
Remove old and broken functionality
2015-11-11 01:07:28 +01:00
Robert Gerus
4deb2609d2
Use a different identifier for user :ping command
2015-11-11 01:06:05 +01:00
Robert Gerus
67e6d39d5e
POC enhanced dispatcher
...
Currently it has multiple O(n) lookups over slices. Should transform it to
map[string]nothing to make it O(1) and possibly prettify the code a bit.
2015-11-11 00:51:12 +01:00
Robert Gerus
1c1f280262
Fix #7 - config package is now reusable
...
Replaced Config type with map[string]string in the process.
2015-11-10 21:00:40 +01:00
Robert Gerus
ebf31d91bb
Fix remainging "hiera" issues
...
Fixes #2 and #5
2015-11-10 02:06:09 +01:00
Robert Gerus
ef80bcd387
It /mostly/ works now.
2015-11-10 00:13:30 +01:00
Robert Gerus
1ad852888a
It's hierryfying and does not build… yet
2015-11-09 14:32:26 +01:00
Robert Gerus
2c0955a168
Make Callbacks a map of maps; Fixes #3
2015-11-09 08:00:13 +01:00
Robert Gerus
07cd403f89
PC might be important to some people…
2015-11-09 01:49:40 +01:00
Robert Gerus
e816e72743
Add a separate dispatcher for PRIVMSG
...
We're going to use that one a lot more than the others…
2015-11-09 01:46:08 +01:00
Robert Gerus
6815bb3000
Cleanup the dispatcher.
2015-11-08 22:50:41 +01:00
Robert Gerus
7a8c07445e
Fix the synchronisation issues…
2015-11-08 22:00:33 +01:00
Robert Gerus
6ad165c880
It responds to pings now
2015-11-08 20:55:47 +01:00