Code Monkey home page Code Monkey logo

apib's People

Contributors

xrogaan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

apib's Issues

Problems on deleted posts

If the latest post is deleted, on next parse the bot will repost the new latest message (but only that one, not the whole feed).

This is related to the time marker feature.

Crash if remote forum is not up

Warning: bozo error in effect!!!
Traceback (most recent call last):
  File "main.py", line 339, in <module>
    bot.our_start()
  File "main.py", line 120, in our_start
    self.start()
  File "/home/swh/apib/irclib/ircbot.py", line 247, in start
    SimpleIRCClient.start(self)
  File "/home/swh/apib/irclib/irclib.py", line 1141, in start
    self.ircobj.process_forever()
  File "/home/swh/apib/irclib/irclib.py", line 234, in process_forever
    self.process_once(timeout)
  File "/home/swh/apib/irclib/irclib.py", line 222, in process_once
    self.process_timeout()
  File "/home/swh/apib/irclib/irclib.py", line 194, in process_timeout
    self.delayed_commands[0][1](*self.delayed_commands[0][2])
  File "main.py", line 233, in m_privmsg
    messages = messages()
  File "./mods/feedreader/phpBBReader.py", line 185, in get_scheduled_output
    messages = self.parse(url)
  File "./mods/feedreader/phpBBReader.py", line 101, in parse
    print ">>> (%s) %s" % (urlError.reason[0],urlError.reason[1])
AttributeError: 'SAXParseException' object has no attribute 'reason'

Resolution: use urlError.getMessage() instead.

Needs to know kungfu

This is one major component since it end up to provide a valid combat behavior for users interacting with the bot. The basic idea is to provide random
sentences in case of aggression. But that's not fun since all sentences are
predetermined. Instead, the bot could generate sentences based on random
numbers. In a more advanced way, the bot could provide users a character
cheet with basics informations like streng, agility, intelligence, etc..

Crash on connexion lost

If the network fails, the bot crashes instead of trying to reconnect.

First thing to do is to correct the feedparser, which introduce the crash (the bozo error).

Here is a backtrace:

Warning: bozo error in effect!!!
>>> (110) Connection timed out
Traceback (most recent call last):
  File "main.py", line 339, in 
    bot.our_start()
  File "main.py", line 120, in our_start
    self.start()
  File "/home/swh/apib/irclib/ircbot.py", line 247, in start
    SimpleIRCClient.start(self)
  File "/home/swh/apib/irclib/irclib.py", line 1139, in start
    self.ircobj.process_forever()
  File "/home/swh/apib/irclib/irclib.py", line 234, in process_forever
    self.process_once(timeout)
  File "/home/swh/apib/irclib/irclib.py", line 222, in process_once
    self.process_timeout()
  File "/home/swh/apib/irclib/irclib.py", line 194, in process_timeout
    self.delayed_commands[0][1](*self.delayed_commands[0][2])
  File "main.py", line 234, in m_privmsg
    for msg in messages:
TypeError: 'NoneType' object is not iterable

Flood on parsing feeds

If somebody write a lot of messages in a little time, the bot will then flood the channel.

A solution is to group the messages by author or threads like this :
Thread '$name' got $num new messages. ($linkToThread)
$name posted in $threadsName

Where :

  • $threadsName is a list of the thread where the author posted.
  • $name is the nickname of the guy
  • $num is the number of messages
  • $linkToThread is a link to the thread first new message

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.