Permalink
Switch branches/tags
Nothing to show
Commits on Jan 11, 2010
Commits on Jan 10, 2010
  1. some minor URL.pm changes.

    Rick E committed Jan 10, 2010
Commits on Dec 24, 2009
  1. fix typo, max_retrys -> max_retries

    James S committed with CodeBlock Dec 24, 2009
  2. clean up the argument list to two lines instead of 3. I did not put t…

    …hem all on one line as that sacrifies clarity of reading for breverity.
    James S committed with CodeBlock Dec 24, 2009
  3. Alright, if you pull this commit and use the bot as is, it should have a

    correct memory of the last seen message by each person. If more then one
    message needs to be remembered, change the value of
    $last_seen_messages->{$channel}{$user} to an array intead of a string
    and check elements, poping the oldest element off if it is greater then
    say 3 or 4 messages. This is all in the function check_seen_messages and
    is the only place in the code that would need to be modified if this is
    a desired feature. The change is almost trivial ;).
    James S committed with CodeBlock Dec 24, 2009
  4. add a call counter and a check that the counter is not greater then $…

    …max_retries
    James S committed with CodeBlock Dec 24, 2009
  5. add a test function, plus modify fetchr some more to make it more con…

    …cise and clearer
    James S committed with CodeBlock Dec 24, 2009
  6. this function is no longer a debugging function so... lets remove tha…

    …t comment and add a real one explaining what it does and what assumptions we make.
    James S committed with CodeBlock Dec 24, 2009
  7. so much for last commit of the night, added check_seen_messages, usin…

    …g this will give blink a memory
    James S committed with CodeBlock Dec 24, 2009
  8. Last commit for the night on this I think, but we don't need to call

    random twice. Before this commit we actually had mysql doing RANDOM,
    then doing return @data[int(rand(@data))] on an array of length
    _one_. I've changed this to return $data[0]; for the time being.
    
    The best way to go from here is to keep a hash with matching channels ->
    users with the value of the hash being the last message printed out by
    the bot. re-request a quote if the hash and the user matches up. If you
    get the same quote 3 times, give up and print it again. (or count the
    number of entries in the database for that user, if its 1... don't keep
    re-requesting as that is an infinate loop.
    James S committed with CodeBlock Dec 24, 2009
  9. fetch_grab_row always returns one row or nothing, so no need for an e…

    …laborate test involving int(@array) = 0 if @array is really undef
    James S committed with CodeBlock Dec 24, 2009
  10. add comments to functions and remove extra comma

    James S committed with CodeBlock Dec 24, 2009
  11. add new function, fetch_grab_row, I might have this return who did th…

    …e grab as well as the actual message.
    James S committed with CodeBlock Dec 24, 2009
  12. move the two prepared queries outside of the function body itself. That

    saves computing the query on each function call. Not *that* important
    but I'm picky ;)
    James S committed with CodeBlock Dec 24, 2009
  13. note what dependencies this has. May want to do something fancy with …

    …with this so cpan can make use of it. But this beats digging for the deps manually.
    James S committed with CodeBlock Dec 24, 2009
Commits on Sep 26, 2009
  1. Fixed URL::shorten, added Lang::define (broken)

    I fixed up URL::shorten() a bit, which failed when a user listed a
    current shortened-link. I also added Lang::define, but it is currently
    broken. A re-write of the function is in sight.
    Rick E committed Sep 26, 2009