r/coding • u/crushh_87 • Mar 04 '14
Tweet my Twitter bot your code! It supports 20 programming languages! (@TheCodeBot Lang: Code)
https://twitter.com/TheCodeBot11
u/jdelStrother Mar 04 '14
Disappointed that I couldn't persuade it to infinite-loop itself with a quine : https://twitter.com/TheCodeBot/status/440830028612268032
1
3
5
u/dadosky2010 Mar 04 '14
PHP: shell_exec("sudo rm -rf /");
3
u/crushh_87 Mar 04 '14
I'm no PHP expert but I'm assuming this is something malicious
1
u/dadosky2010 Mar 04 '14
It runs a shell command to delete everything on the hard drive.
rm -rfmeans "Remove recursively (i.e. remove folders too.) and / is the root folder (That contains everything.). It most likely would not work as it would require a password of someone withsudoaccess. (Sudo allows for you to run commands as root.).
2
u/Fsmv Mar 04 '14
I tried "@TheCodeBot Perl: $_=q{print"@TheCodeBot Perl: $_=q{$_};eval;"};eval;" which is a quine, but it didn't work. The bot just sent me an empty reply.
If it had worked it would print its code exactly, would the bot see its reply to itself and run it again even if my username was at the beginning of its reply?
3
u/crushh_87 Mar 05 '14
No because for the tweet to get complied it must start with @TheCodeBot. I reply to every tweet so the tweet would be "@YourUserName @TheCodeBot blah blah code", And since it does not start with @TheCodeBot I don't even mess with it.
Edit: I won't lie, this was actually not intended...
15
7
Mar 04 '14
You should repost it on /r/programmerhumor with all the compilation errors being tweeted! Awesome project though!
1
1
1
u/crushh_87 Mar 04 '14
This is my first reddit post thing ever. Sorry if I broke rules or something.
10
u/theghostofcarl Mar 04 '14
It would be cool if we could tweet it a gist with code in it.
4
u/crushh_87 Mar 04 '14
I could work on this... I will look tomorrow after school, work and other things
1
0
13
u/Raticide Mar 04 '14
How do you prevent malicious code?