-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fake user registration script & basic markdown files #1
base: master
Are you sure you want to change the base?
Conversation
You're doing too much in this PR. You're removing old code without replacing it with new code, changing the structure of the code, and migrating to requests. You're also introducing new features (Tor). These are done in non-atomic commits (even though your commits are split by file, this isn't enough). Consider splitting it into multiple PRs and with atomic commits. |
Please use a separate feature branch to make PRs. Don't push to your master. |
print '[-] Unsuccessful Tor Connection' | ||
sys.exit(1) | ||
else: | ||
print '[+] Tor Running Normally' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use Tor here. We'll separate this ability, if needed into a different module (and certainly a new file). Let's leave this for another PR.
shell_exec( "git push origin " . $branch ); | ||
shell_exec( "hub pull-request -f -m 'Implemented update' -h sybiliansybiler842064670:" . $branch . " -b spasmilo:master" ); | ||
} | ||
?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can keep this file until a suitable replacement is written in Python. In any case, let's move this removal to a separate PR.
return sock | ||
|
||
|
||
def verifyTor(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Please follow pep8
from faker import Faker | ||
fake = Faker() | ||
|
||
url = 'https://github.com/join' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Use upper case for naming constants
|
||
import urllib2, random, requests, urllib2, socket, socks, sys | ||
from bs4 import BeautifulSoup | ||
from time import sleep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import. Please use pylint or some other python linter to find out such obvious issues before committing.
} | ||
#print payload | ||
|
||
headers = {'User-Agent': 'Mozilla/5.0', 'referer': url} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move constants and name at top of file (e.g. user agent)
buffer = StringIO() | ||
|
||
c = pycurl.Curl() | ||
c.setopt(c.URL, 'https://github.com/notifications/subscribe') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until you've written a replacement for the watchers, please don't remove this file yet.
|
||
if 'already taken' not in result.text.encode('utf-8'): | ||
with open('data/users.txt', 'a') as mf: | ||
mf.write(",".join(identity.values()) + '\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you just want to export the identifies, collect them into an array and marshall them using some standard (e.g. the Python pickle or, preferably, json).
mf.write(",".join(identity.values()) + '\n') | ||
print '[+] Account', str(identity['username']), 'has been successfully created!' | ||
else: | ||
print '[-] Username', str(identity['username']), 'already taken.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit messy to print within this function. This function is responsible for the creation of a user account on GitHub. It should be reusable as such. If it's used within a bigger project as a library, it's very undesirable that it prints wildly and without letting the caller know what happened. A cleaner design is to have the create_user function return the identity created (so that the caller can print it or use it in some manner), or throw an exception (that you will have to define) if there's some failure such as the "already taken" case (where the caller can also decide to print it).
print csrf_value | ||
pass | ||
|
||
github_token_get( 'dionyziz/endofcodes/', 'login' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You haven't implemented the login functionality yet, so please don't remove this file at this time.
Amendments: