Matthias Hecker [Thu, 14 Nov 2013 13:41:16 +0000 (13:41 +0000)]
always print FATAL and ERROR logmessages to STDERR
This adds a print to $stderr for log messages with the
level ERROR or FATAL. I did this because in the past errors
connecting to the server weren't immediately obvious but
rather hidden in the logfile. I think it should be right
in-your-face when the connection doesn't work.
It would probaply be better to extend Logger to print
to STDERR but this apparently requires monkeypatching ruby's
Logger. Anyhow I think my solution works for now.
Matthias H [Wed, 18 Sep 2013 01:18:13 +0000 (03:18 +0200)]
ruby 2.0.0: better fix for the ThreadError
I revisited my fix for the ThreadError in ruby 2.0.0
this doesn't use a queue for signals but just starts a
thread for each received signal, works much better for me.
It also fixes a bug in Bot#reconnect where the SystemExit
exception coming from quit is not handled correctly.
Ruby 2.0.0 crashes with "ThreadError: can't be called from trap context"
anytime a signal is received, because it tries to write a debug message
within the "trap context".
This changes signal handling so that signals are queued and processed
in the main loop.
More information: https://www.ruby-forum.com/topic/4411227
Matthias H [Fri, 19 Jul 2013 14:26:24 +0000 (16:26 +0200)]
updates the twitter plugin to use the new api 1.1
The old 1.0 api is no longer available.
Its using oauth2 for application-only authentication and
oauth(1.0a) for user authentication.
Now requests and parses json (the new API doesn't support XML)
Giuseppe Bilotta [Mon, 21 Jan 2013 18:41:38 +0000 (19:41 +0100)]
rss: protect against nil field
This happens when the filter tries to wrap a non-existing field, and in
custom filters it's probably a sign that the wrong field are being
accessed. It would probably be nicer to raise a warning about this, but
I'm too lazy to add that now.
Giuseppe Bilotta [Fri, 21 Sep 2012 12:55:42 +0000 (14:55 +0200)]
poll: handle privately-asked polls
When a poll is asked in private, its channel will be empty. Make sure
that communication go in private again, and do mention that the poll was
asked in private in the poll info.
Giuseppe Bilotta [Fri, 14 Sep 2012 06:55:39 +0000 (08:55 +0200)]
search: improve ddg output with missing sources
Sometimes duckduckgo fails to report the source/url of a definition or
abstract. Cope with this by removing the leading double dash when no
source information is provided
Giuseppe Bilotta [Tue, 20 Mar 2012 11:13:17 +0000 (12:13 +0100)]
Forecast plugin patch
"I've updated the forecast plugin, the two API URLs used had been updated and
the NOAA SOAP API method call now requires 6 arguments instead of the 5 it was
passing previously." (Ticket #89)
Giuseppe Bilotta [Wed, 25 Jan 2012 08:44:40 +0000 (09:44 +0100)]
search: fix gcalc
Google changed their layout again. To be a little more future-proof,
split the html into as many <br/> sections as there are, and pick the
first one that contains the literal string ' = ' if there is one.
Giuseppe Bilotta [Mon, 26 Dec 2011 09:57:54 +0000 (10:57 +0100)]
greed: refactor and prepare for more complete play
The score is now saved in a look-up table, that also allows more
detailed output when showing the score. Also, the dice rolling
potentially allows for a different number of dices to be rolled (e.g. if
some are held).
Giuseppe Bilotta [Wed, 21 Dec 2011 22:29:35 +0000 (23:29 +0100)]
twitter: preliminary status htmlinfo filter
This allows the link info published by URL in the new /#!/ format to be
more meaningful than the warning about missing JavaScript support caused
by the new "web 2.0" Twitter site.
Giuseppe Bilotta [Sat, 11 Jun 2011 14:26:09 +0000 (16:26 +0200)]
Saner treatment for connect errors
Rather than raising changing the message (a message that would not be
displayed anyway), display the (composed) error message and then reraise
without further changes.
This prevents them from being delegated to unreplied() before the processing
thread has the chance to mark it replied. The solution would fail for
threaded messages whose processing would not reply, but I'm not aware of
such a method currently exists.
A future design of the message delegation and mapping could thread the
actual delegation instead, and this problem would be solved.
Giuseppe Bilotta [Wed, 11 May 2011 18:25:20 +0000 (20:25 +0200)]
weather: refactor NWS output
Aside from gettexting, this separates out all the data that is available
in both metric and imperial units, to allow a potential extension for
support for the user choice of units.
Giuseppe Bilotta [Wed, 11 May 2011 17:53:37 +0000 (19:53 +0200)]
weather: fall back from nws to wu
If a user uses NWS as default service and asks for a location that the
our NWS implementation can't retrieve, fall back to the Weather
Underground service.
To simplify this management, rewrite the code to use the bot HTTP util
and its caching functionality.
Giuseppe Bilotta [Wed, 11 May 2011 16:18:04 +0000 (18:18 +0200)]
weather: URI-encode station
The NWS code assumed that the station could be used as-is in the URL,
which is actually true for the station codes accepted by NWS, but
incorrect in general. People with NWS as the default weather service
would get strange errors about bad URIs if trying something like
"weather birmingham, uk".
Solve by URI-encoding the station name: even if the resulting URL will
still give a 404, at least it doesn't give out odd errors.
Giuseppe Bilotta [Tue, 10 May 2011 06:19:13 +0000 (08:19 +0200)]
bdb: don't retrieve the db values when warning about nil key
When either of the keys passed to the BDB compare function is nil, we
emit a warning. In this warning, however, we used to peek at the
registry value, which required the use of the comparison function
itself, falling in a nested loop. Solve by omitting the
self[<key>].inspect from the warning.