Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fake user registration script & basic markdown files #1

wants to merge 5 commits into from

Conversation

k4m4
Copy link

@k4m4 k4m4 commented Oct 1, 2017

Amendments:

  • Removed depreciated scripts
  • Created fake user registration script
  • Created plain readme file
  • Created MIT license file
  • Created requirements file
  • Created gitignore file

@dionyziz
Copy link
Member

dionyziz commented Oct 4, 2017

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.

@dionyziz
Copy link
Member

dionyziz commented Oct 4, 2017

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'
Copy link
Member

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" );
}
?>
Copy link
Member

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():
Copy link
Member

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'
Copy link
Member

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
Copy link
Member

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}
Copy link
Member

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')
Copy link
Member

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')
Copy link
Member

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.'
Copy link
Member

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' )
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants