Coder Social home page Coder Social logo

bonzbot's People

Contributors

hrbonz avatar

Watchers

 avatar  avatar

Forkers

sclo

bonzbot's Issues

Add a "push to a given subreddit" command

It would be great to add a new command set that would work like that:

query commands:

  • set a reddit account (create/update account)

    <foobar> reddit account set myaccount login password
    or
    <foobar> reddit account set myaccount apikey
    then it would answer
    <bonzbot> account myaccount (created|updated)
    
  • delete a reddit account

    <foobar> reddit account delete myaccount
    then it would answer
    <bonzbot> account myaccount deleted
    
  • show reddit account list

    <foobar> reddit account list
    <bonzbot> Account list:
    <bonzbot>   - reddit myaccount loginname
    <bonzbot>   - reddit myaccount loginname
    
  • add a subreddit linked to a reddit account

    <foobar> reddit add myaccount /r/devel #mychannel 
    <bonzbot> subreddit output added
    
  • delete a subreddit linked to a reddit account

    <foobar> reddit delete myaccount /r/devel #mychannel 
    <bonzbot> subreddit /r/devel deleted from myaccount
    

channel #mychannel commands:

  • push a new tagged link to a given subreddit
    <foobar> !reddit push /r/devel httplink tag1,tag2,tag3 description
    
  • shows last n links
    <foobar> !reddit latest  n /r/devel
    <bonzbot>  link#1 tags description
    <bonzbot>  link#2 tags description
    [...]
    <bonzbot>  link#n tags description
    

handle 403 and other error HTTP status codes [linkinfo]

When opening https://engineering.upside.com/a-beginners-guide-to-optimizing-pandas-code-for-speed-c09ef2c6a4d6

ERROR asyncio    Exception in callback event.async_callback({'data': 'https://engi...-c09ef2c6a
4d6', 'event': 'PRIVMSG', 'mask': 'anhj!~anhj@l...2.litchis.org', 'target': '#bonz'})
handle: <Handle event.async_callback({'data': 'https://engi...-c09ef2c6a4d6', 'event': 'PRIVMSG
', 'mask': '[email protected]', 'target': '#bonz'})>
Traceback (most recent call last):
  File "/home/hr/codaz/bonzbot/bonzbot/linkinfo/__init__.py", line 41, in get_title
    soup = bs4.BeautifulSoup(urlopen(req, timeout=5), "lxml")
  File "/usr/lib/python3.4/urllib/request.py", line 153, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.4/urllib/request.py", line 461, in open
    response = meth(req, response)
  File "/usr/lib/python3.4/urllib/request.py", line 571, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.4/urllib/request.py", line 493, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.4/urllib/request.py", line 676, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.4/urllib/request.py", line 461, in open
    response = meth(req, response)
  File "/usr/lib/python3.4/urllib/request.py", line 571, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.4/urllib/request.py", line 499, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.4/urllib/request.py", line 579, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run
    self._callback(*self._args)
  File "/home/hr/.virtualenvs/bonzbot3/lib/python3.4/site-packages/irc3/dec.py", line 54, in as
ync_callback
    return self.callback(**kwargs)
  File "/home/hr/codaz/bonzbot/bonzbot/linkinfo/__init__.py", line 68, in getlink
    info = self.get_info(link)
  File "/home/hr/codaz/bonzbot/bonzbot/linkinfo/__init__.py", line 58, in get_info
    return _handler(match)
  File "/home/hr/codaz/bonzbot/bonzbot/linkinfo/__init__.py", line 42, in get_title
    except urllib2.HTTPError as e:
NameError: name 'urllib2' is not defined

Auto deop module

Add a simple module to auto deop self, the bot should never have any special credentials in the chan.

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.