-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Password Generator Created #1111
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| from plugin import plugin | ||
| from colorama import Fore | ||
| import requests | ||
|
|
||
| @plugin("generate_password") | ||
|
|
||
| def generate_password(jarvis, s): | ||
| length = int(jarvis.input("Desire password length: ")) | ||
| inp = str(jarvis.input("Would you like to exclude numbers? (Y/N) : ")) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. casting to a str here is un-necessary, by default an input return type is str. |
||
| if(inp == 'Y'): | ||
| exclude_numbers = True | ||
| else: | ||
| exclude_numbers = False | ||
|
|
||
| inp = bool(jarvis.input("Would you like to exclude special characters? (Y/N) : ")) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fairly certain this would always evaluate to true as any string is a truthy value. |
||
| if(inp == 'Y'): | ||
| exclude_special = True | ||
| else: | ||
| exclude_special = False | ||
| api_url = 'https://api.api-ninjas.com/v1/passwordgenerator?length={}'.format(length, exclude_numbers, exclude_special) | ||
| response = requests.get(api_url, headers={'X-Api-Key': 'dDcouxccX+Ne1OKZj+rRrw==CW8Mg7Tvlk3u8omW'}) | ||
| if response.status_code == requests.codes.ok: | ||
| print(response.text) | ||
| else: | ||
| print("Error:", response.status_code, response.text) | ||
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.
remove whitespace