Code Monkey home page Code Monkey logo

compilebot's People

Contributors

renfredxh avatar robotcaleb avatar wchill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

compilebot's Issues

Add http monitoring

Add a flask server in deploy.py that responds 200 OK to help keep tabs on when the bot is up and running.

Buffer exceptions in deploy.py

Right now while exceptions are being handled in deploy.py, there is a chance the logging function may cause it's own exceptions and crash the program. On exception, stack traces should be added to a buffer and sent during the try block at the top of the loop.

Fix NoneType error on spam check

Error processing comment 2q5prs Traceback (most recent call last): File "/compilebot/compilebot/compilebot.py", line 473, in main process_unread(new, r) File "/compilebot/compilebot/compilebot.py", line 26, in wrapper return func(args, *kwargs) File "/compilebot/compilebot/compilebot.py", line 454, in process_unread if spam and new.subreddit.display_name not in IGNORE_SPAM: AttributeError: 'NoneType' object has no attribute 'display_name'

C# unsafe code

Allow for c# unsafe code to be compiled if possible? thank you

No repiy returned if the mension's permalink contains non-ascii character

It seems that compilebot doesn't reply for the compile request mention if the mention's permalink contains non-ascii character. For example:

  1. https://www.reddit.com/r/test/comments/6rov8e/compilebot_test/dl6nlsp/ - works as intended
  2. https://www.reddit.com/r/test/comments/6roxtv/compilebot_%E3%83%86%E3%82%B9%E3%83%88/dl6o5qp/ - doesn't work

I think urllib.quote(comment.permalink) (link) raises some error because PRAW's comment.permalink() returns unicode type which may contain non-parcent-encoded unicode characters and urllib.quote() doesn't accept unicode type:

>>> comment = next(reddit.get_unread())
>>> comment.permalink
u'https://www.reddit.com/r/:subreddit/comments/:submission_id/\u30c6\u30b9\u30c8\u30b9\u30ec\u30c3\u30c9/:comment_id'
>>> print comment.permalink
https://www.reddit.com/r/:subreddit/comments/:submission_id/テストスレッド/:comment_id
>>> from urllib import quote
>>> quote(comment.permalink)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1299, in quote
    return ''.join(map(quoter, s))
KeyError: u'\u30c6'

Add proper logging

Instead of logging to a file, main should log to stdout by default, so its logs can be accessed easily by containers.

Catch Ideone Connection Errors

14-11-29 17:56:42: Error processing comment cmg8rry Traceback (most recent call last): File
"/compilebot/compilebot/compilebot.py", line 473, in main processunread(new, r) File
"/compilebot/compilebot/compilebot.py", line 26, in wrapper return func(args, *kwargs) File
"/compilebot/compilebot/compilebot.py", line 383, in process_unread reply = create_reply(new) File
"/compilebot/compilebot/compilebot.py", line 316, in create_reply details = compile(src, lang, stdin=stdin)
File "/compilebot/compilebot/compilebot.py", line 185, in compile details = i.submission_details(sub_link)
File "build/bdist.linux-x86_64/egg/ideone/init.py", line 288, in submission_details with_compilation_info)
File "build/bdist.linux-x86_64/egg/suds/client.py", line 542, in __call_ return client.invoke(args, kwargs)
File "build/bdist.linux-x86_64/egg/suds/client.py", line 602, in invoke result = self.send(soapenv) File
"build/bdist.linux-x86_64/egg/suds/client.py", line 637, in send reply = transport.send(request) File
"build/bdist.linux-x86_64/egg/suds/transport/https.py", line 64, in send return HttpTransport.send(self,
request) File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 79, in send result = Reply(200,
fp.headers.dict, fp.read()) File "/usr/lib/python2.7/socket.py", line 351, in read data =
self._sock.recv(rbufsize) File "/usr/lib/python2.7/httplib.py", line 567, in read s = self.fp.read(amt) File
"/usr/lib/python2.7/socket.py", line 380, in read data = self._sock.recv(left) error: [Errno 104] Connection
reset by peer

Refactor Configs

Config should be imported via a separate python module (like in Flask) and use environment variables where possible.

Allow outputting formatted text

Currently the bot prints the stdout in a code-formatted markdown section. It would be nice if there was an option to have stdout set as the bot comment content directly. For example:

Comment invoking the bot:

+/u/CompileBot python3 --raw-output

print("**test**")

Bot response:

test

or

test
source | info | git | report

BANNED_USERS is None

Deal with the following error:

15-02-25 16:56:53: Error processing comment cowt85e Traceback (most recent call last): File
"/compilebot/compilebot/compilebot.py", line 486, in main process_unread(new, r) File
"/compilebot/compilebot/compilebot.py", line 27, in wrapper return func(args, *kwargs) File
"/compilebot/compilebot/compilebot.py", line 383, in process_unread if sender.name.lower() in
BANNED_USERS: TypeError: argument of type 'NoneType' is not iterable

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.