Permalink
Switch branches/tags
Nothing to show
Commits on Nov 15, 2015
  1. Campfire::Base: use scalar context for accessors

    peff committed Nov 15, 2015
    Older versions of XML::Smart were happy to access scalar XML
    items in an array context. But since upgrading to jessie,
    with XML::Smart 1.78, this now causes a perl error.
    
    I'm not sure if this is a bug in XML::Smart, or a problem in
    my code, but we can easily work around it by using a scalar
    context (this means that the _accessor() helper can't be
    used for arrays anymore, but I don't think any call sites do
    so).
Commits on Oct 11, 2013
  1. Revert "Campfire: don't feed raw scalar reference to curl"

    peff committed Oct 11, 2013
    This reverts commit 5efaf6b.
    
    It now seems broken on more recent versions of curl/perl.
    Again, I'm still unsure of the exact cause or broken
    version. But given that the original commit was to make
    debian squeeze happy, and it's now mostly obsolete, let's
    just revert.
Commits on Apr 18, 2013
  1. Campfire: don't feed raw scalar reference to curl

    peff committed Apr 18, 2013
    Newer versions of WWW::Curl are happy for us to hand a
    scalar reference to WRITEDATA, and store the output in the
    scalar. Older versions (including the one on Debian
    squeeze) want a real filehandle.
    
    It's not clear to me if this is related to the version of
    curl, WWW::Curl, or perl. In any case, it's easy to work
    around by asking perl to create a filehandle that outputs to
    the scalar.
Commits on Mar 5, 2013
  1. Campfire/Message: learn to stringify LeaveMessages

    peff committed Mar 5, 2013
    This should have been added along with EnterMessage, but I
    somehow missed it.
Commits on Dec 4, 2012
  1. pad "--all" days by one on either side

    peff committed Dec 4, 2012
    The Campfire API leaves unspecified the time zone in which a
    transcript's day occurs. So after midnight local time, the
    client may think it is now a new day, whereas the server
    does not; we will miss messages sent during that time
    period, because we cut-off our search by day. Padding
    backwards 1 day solves that, at the expense of requesting
    too much data.
    
    Similarly, if it is not yet midnight on the client, the
    server may already think it is "tomorrow", and querying by
    day will not get new messages until the day counter rolls
    over locally. This can be fixed by padding one day into the
    future.
Commits on Apr 10, 2011
  1. build version file from git

    peff committed Apr 10, 2011
    I'm planning on making tarballs via "mfm dist", so we need
    version numbers. Using git tags seems like a reasonable
    plan.
  2. README: note that mfm is available these days

    peff committed Apr 10, 2011
    Not that anyone actually has it installed, so let's point
    them to the git repo.
Commits on Apr 6, 2011
  1. camptail: notice room changes during grep

    peff committed Apr 6, 2011
    Because grep treats the messages as a single stream,
    regardless of room, if we are grepping with -A/-B, we may
    end up showing unrelated messages from another room.
    
    This has always been the case, and in the context of
    matching "recent" messages, it is not that bad.
    Conversations from another room might actually be relevant.
    But with transcripts, they are almost certainly not, because
    we lose all time locality.
    
    And especially when you are grepping, it gives you a bunch
    of irrelevant context lines to read through, which is
    annoying. So let's just drop it.
Commits on Apr 1, 2011
  1. camptail: add --grep-cb option

    peff committed Apr 1, 2011
    The regular --grep=<foo> uses <foo> as a regular expression.
    Using --grep-cb=<foo> works the same way, except that we
    treat <foo> as callback code to tell us whether a line is
    interesting. This lets one grep differently based on things
    like message type or room.
  2. camptail: refactor make_callback to be generally useful

    peff committed Apr 1, 2011
    As we introduce new types of callback, we can reuse this
    code.
Commits on Mar 31, 2011
  1. fix --callback breakage with actual code

    peff committed Mar 31, 2011
    The regex to detect simple function calls in 4a7d9bc was
    totally wrong, and it ended up thinking everything was a
    function call. This broke actual code like:
    
      camptail --callback='print $message->id, "\n"'
    
    as it got the "(@_)" appended.
Commits on Mar 28, 2011
  1. camptail: automagically pass arguments to callback functions

    peff committed Mar 28, 2011
    A callback like "foo" is pointless. It will call the foo
    function, but not pass any arguments, so the result can't
    have any information about the message or room we are
    processing. Instead, let's convert it into "foo(@_)".
    
    This means you can define some pre-made callbacks in your rc
    file, and then use them like "camptail --callback=foo".
  2. RoomFilter: treat filters as regular expressions

    peff committed Mar 28, 2011
    You can now do "camptail -r danger.room"" instead of "The
    Danger Room" (or even just "-r danger"). Which is way
    handier.
  3. factor out room-selection filtering

    peff committed Mar 28, 2011
    This is in preparation to handle regular expressions; the
    code was getting a little hairy for the main script.
Commits on Mar 24, 2011
  1. mark stdout as utf8

    peff committed Mar 24, 2011
    The input we get from campfire is properly encoded (and
    seems to just be utf8), but perl complains about us spewing
    wide characters to stdout. Let's tell it that utf8 is what
    we want.
  2. document that we now require DateTime

    peff committed Mar 24, 2011
    We could actually make requiring this conditional on using
    --all, but pretty much everybody has DateTime, so I'm not
    going to worry about it.
  3. use transcript to handle large (or multi-day) tails

    peff committed Mar 24, 2011
    Tailing via recent will get us at most the 100 last
    messages. This is not enough for polling even every hour in
    a busy room. Instead, let's use the transcript API to just
    pull whole days.
    
    We can start tracking the last day pulled in the RoomState
    file, so we won't pull old days over and over again. But we
    still have to keep pulling the _entire_ current day as it
    gets added to, because there is no way to limit it at the
    API level.
  4. Room: add transcript command

    peff committed Mar 24, 2011
    The recent command is quite limited; it will only pull the
    last 100 messages. This is way too few for something like my
    campmail-style grepping. What I really want is to say "this
    is the last id I got, and show me everything in this room
    since then".
    
    Sadly, the transcript API doesn't seem to take a "since"
    parameter, so we're stuck pulling the whole daily transcript
    and grepping it ourselves.
  5. handle topic change messages

    peff committed Mar 24, 2011
    Just another text message with a prefix.
Commits on Mar 16, 2011
  1. default to --no-follow

    peff committed Mar 16, 2011
    Since the addition of the state-file, I find that I am less
    interested in live-following and more interested in reading
    backlogs when convenient. So I rarely want to actually
    follow these days.
Commits on Feb 16, 2011
  1. camptail: add --state option

    peff committed Feb 16, 2011
    This option will keep the room-state in a file from run to
    run, so that you can periodically get new messages without
    having to keep a streaming connection open.
    
    Note that this is not connected to streaming at all. In
    particular, streamed data will not go into the state file.
    This is mostly out of laziness on my part, since it is not
    clear when the state file should be written while streaming,
    and for my purposes, this is about periodic polling, not
    streaming.
  2. Room: let the caller specify since_message_id

    peff committed Feb 16, 2011
    Until now we always just used our local last_message id. But
    the caller may want to keep outside of a single run.
  3. camptail: support -A and -B for grep context

    peff committed Feb 16, 2011
    Like regular grep, you can now get the context around a hit
    line like:
    
      camptail --grep=peff -B 10 -A 5
  4. camptail: add --grep option

    peff committed Feb 16, 2011
    This can be used to grep for a pattern in the tail content,
    like:
    
      camptail --no-follow --grep=peff -r 'The Danger Room' -t 1000
    
    Note that the pattern is case-insensitive for convenience.
  5. camptail: add --print option

    peff committed Feb 16, 2011
    This is a synonym for --callback='print_message(@_)', but
    obviously much nicer to type. It's the default, of course,
    but the important thing is that --print will override
    config.
  6. camptail: let "-r" on command line override config

    peff committed Feb 16, 2011
    As it is now, it just adds to it, which is kind of useless
    if you have rooms in your config. Instead, it should
    override the config completely (but multiple "-r" will give
    multiple rooms).
  7. camptail: only enter rooms if we are going to follow

    peff committed Feb 16, 2011
    Entering is only required for streaming, so if we're not
    streaming, there's no point (and it is weird since it lets
    everyone else know we're there).
  8. camptail: make following optional

    peff committed Feb 16, 2011
    We still follow by default, but you can use --no-follow to
    turn it off.
Commits on Jan 14, 2011
  1. camptail: add '-r' option to monitor specific rooms

    peff committed Jan 14, 2011
    Instead of looking at rooms we're already in (presumably
    from the web interface), this enters and monitors a specific
    set of rooms (use -r multiple times, or @want_rooms in your
    config file).
  2. Room: allow entering rooms

    peff committed Jan 14, 2011
    This is necessary if we want to stream rooms that we did not
    already enter via the web interface.
  3. Campfire: handle POST requests

    peff committed Jan 14, 2011
    This will be necessary for room-entering (and eventually
    other things, if this script keeps growing).
    
    The code is very similar to the GET method, but not quite
    enough to make refactoring worthwhile.
  4. Campfire: support fetching the whole room list

    peff committed Jan 14, 2011
    The code is almost identical to presence, so let's factor it
    out.
  5. todo: drop completed "streaming" item

    peff committed Jan 14, 2011
    Implemented in d0e1632.
  6. README: add an example camptailrc

    peff committed Jan 14, 2011
    This shows better what it is actually good for (i.e., custom
    notifications).
  7. rename campfirerc to camptailrc

    peff committed Jan 14, 2011
    This is a better name, and less likely to conflict with
    other tools.