Giuseppe Bilotta [Sun, 15 Mar 2009 10:04:24 +0000 (11:04 +0100)]
rss: configurable announce method
Since the RSS update announcements do not expect any form of reply,
they could be considered the typical IRC message that should use
NOTICE rather than PRIVMSG.
However, for backwards compatibility and since NOTICEs are not always
appreciated (and since their handling from clients is not always
optimal, either), we still allow rss announces to use the traditional
method, and that is in fact selected as default. Explicit rss show
request always go with PRIVMSG.
Giuseppe Bilotta [Fri, 13 Mar 2009 10:50:27 +0000 (11:50 +0100)]
rss: refactor rss types loading
Make use of the new custom filter loading procedure to move most of the
type definitions into its own file (data/rbot/filters/rss.rb) and only
define some essential ones in the plugin itself.
As an added benefit, user types can be loaded from filters/rss.rb and
rss/types.rb in the botclass directory.
reaction: fix trigger regex to work with non-alphanumeric start/end.
only match on word boundaries at an end of a trigger if the character at
that end of the trigger is a word character. In other words, the
trigger "test" should require word boundaries on each side, but the
trigger "@test" should only require one on the right side.
messagemapper: fix regexp creation for double-optional templates
When a mapping template had a double optional key such as
'something [[double] optional]'
the resuting regexp moved the spacing between the (converted)
double brackets, requiring extra spacing before the 'optional'
keyword.
Fix by moving spacing inside all consecutive brackets before converting
brackets into their regexp form.
lastfm: clean up sort order events search mappings
Put some requirements for the sort_order specification, to prevent
lastfm events at alan lomax
to map lomax as a sort order. Also make the 'in' and 'order' words
optional within the optional sord order block, rather than aside, to
prevent them from being ignored in venue names.
Try loading rubygems as soon as we're set up, since it can be needed for
gettext and a number of other things. This also allows us to get rid of
some stupid convoluted tricks in utils.
irc: monkeypatch Singleton to make _load and _dump public.
This is to fix a possible bug in newer versions of ruby where _load was
declared private in singletons. This would lead to errors where Marshal
could not restore the Singleton. This "bug" was introduced to ruby
in revisions 16659 and 17396.
markov: ensure messages are cleaned before learning and replying.
Lines that began with or ended with spaces were breaking the learning
thread. The call to clean_str was moved down into learn_line (and
random_markov) so that all messages, including those being learned from
files, get cleaned.
Giuseppe Bilotta [Fri, 27 Feb 2009 20:40:16 +0000 (21:40 +0100)]
rss plugin: upper limit for watched feeds
Config option to set the maximum number of items that will be announced
when a feed updates. 0 means all of them, anything else clips the list
to the latest ones, and also announces that some of the updates will not
be listed.
Giuseppe Bilotta [Tue, 24 Feb 2009 20:48:34 +0000 (21:48 +0100)]
lastfm: catch all errors when connecting
Since httputil.get_response() can raise exceptions, catch them into an
appropriate block. Turn a missing response body into a runtime error to
handle this error conditions consistently with other exceptions.
Giuseppe Bilotta [Sat, 21 Feb 2009 19:03:53 +0000 (20:03 +0100)]
markov: try harder when generating strings
generate_strings() is now able to work with a single word. Additionally,
when the given lookup is not found in the database, it will try
lookups that start, and failing that include, the given one.
Giuseppe Bilotta [Sat, 21 Feb 2009 23:25:35 +0000 (00:25 +0100)]
registry: spare useless I/O
The each_key()/each_value() methods of the accessor relied on the each()
method of the database, wasting I/O bandwidth and time by loading
unnecessary data (particularly when running each_key() on databases with
ridiculously enormous values such as in the markov plugin case).
Giuseppe Bilotta [Mon, 16 Feb 2009 22:57:10 +0000 (23:57 +0100)]
factoids: pass proper parameter from unreplied()
When passing on the Array of split words from unreplied() to facts()
make sure that the passed argument behaves like an Array/String from
the MessageMapper.
Giuseppe Bilotta [Mon, 16 Feb 2009 20:14:32 +0000 (21:14 +0100)]
lastfm: limits to user data output
Define configuration keys for maximum and default number of user data
items output, with a separate value for shouts (which are usually much
more verbose and therefore would have a much lower maximum and default).
Each command also allow the specification of the number of entries
actually output (different than the default, clipped at the configured
maximum.
This way user data has the same rate limiting as events.
Internally, the switches for the user data are also made more uniform to
select, where it makes sense, different sentences depending on how many
entries are being displayed (none, all, some).