ClouDev/CloudBot — pull request #183 by bbeng89 (2013-11-26 22:44:20+00:00)
Title: Bug fixes in reddit and github plugins

In the reddit plugin you were never able to get the very first post in a subreddit because of line 56:
```
if id_num:
```

If id_num is 0 (the first post) then this line evaluates to false so a random post is chosen instead. This bug is fixed in df6ee28 by checking if id_num != None instead.

The github plugin was throwing the following exception every time you tried to run .ghissues:
```
Unhandled exception in thread started by
Traceback (most recent call last):
File "core/main.py", line 70, in run
out = func(input.inp)
File "plugins/github.py", line 69, in ghissues
return fmt % (number, state, user, title, summary, gitiourl)
TypeError: not all arguments converted during string formatting
```

In 186f272 I changed the string formats to use %s instead of {} and that resolved the issue.

Also, in b2c9f46 I fixed a bug with the truncate function. Newlines were causing a problem that would cause the link to the issue to not appear. For instance, try the command
```
.ghissues cloudev/cloudbot 182
```
I changed the truncate function so that it uses split() instead of split(" "') so that newlines are stripped as well