Take the 2-minute tour ×

I found this code on github: https://github.com/Abrand88/Reddit-Tor-proxy-voting-bot/blob/master/reddit_proxy_voting_bot.py

I know that its a bot and potentially malicious but I thinks its cool nonetheless. From an educational perspective how do I get it working?: When I run the program it outputs "socket:" twice and then gives the error "KeyError: ''"

Any thoughts?

share|improve this question

closed as off-topic by Marc B, Luc M, Jonathan Potter, Tanis.7x, Guillaume Jul 26 '13 at 20:56


  • "Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance." – Marc B, Luc M, Jonathan Potter

so you grab some random code that you think is malicious, run it, and then wonder why it's not working? Do you dive off a cliff to check if there's rocks below it? –  Marc B Jul 26 '13 at 19:48
I love how people try to justify use of illicit software by randomly throwing in the phrase "educational purposes" or "educational perspective", thinking that somehow makes it okay. –  Dan455 Jul 26 '13 at 19:50
Even ignoring all that, there isn't really enough information here to solve the problem... –  StephenTG Jul 26 '13 at 19:55

1 Answer 1

up vote 0 down vote accepted

it's using a dictionary and can't find the key for your local host.

this is probably causing the error breaking:

ip_hash={}; # the dictionary is made


ip_hash[ip] = 1; # the dictionary is incorrectly accessed

this part alone isn't a good idea:

if ip in ip_hash:
    print " repeat " + ip;
    ip_hash[ip] = 1;
share|improve this answer
do you know how i fix this? –  user2551517 Jul 26 '13 at 20:02
I would just redo the code personally; you really don't want to do this though; if reddit finds out they might start throwing ip bans everywhere :/ –  Eiyrioü von Kauyf Jul 26 '13 at 20:48
