Improved emails from url#4181
Improved emails from url#4181AyushSehrawat wants to merge 16 commits intoTheAlgorithms:masterfrom AyushSehrawat:master
Conversation
|
Finally solved all the issues 👍 |
|
I will consider your changes 😊. |
ghost
left a comment
There was a problem hiding this comment.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
ghost
left a comment
There was a problem hiding this comment.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
| """ | ||
|
|
||
|
|
||
| def getmails(num: int) -> None: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file web_programming/emails_from_url_alt.py, please provide doctest for the function getmails
|
|
|
Waiting for review :) |
| """ | ||
|
|
||
|
|
||
| def getmails(num: int) -> None: |
There was a problem hiding this comment.
| def getmails(num: int) -> None: | |
| def get_mails(url: str, max_emails: int = 5000) -> list: |
Callers are going to assume that a get_ function returns what it gets.
There was a problem hiding this comment.
Should the list be ordered by first found or alphabetically?
There was a problem hiding this comment.
max_emails can be a wrong variable , since the int value is a loop , which runs to find the links and emails.
We can't tell the max emails.
There was a problem hiding this comment.
while urls and len(emails) < max_emails:
There was a problem hiding this comment.
Now that I see how this works, I think we need to change the function signature:
def get_mails(urls: list, max_emails: int = 5000) -> list:
|
|
||
| if __name__ == "__main__": | ||
| user_url = "https://google.com" # Example Url | ||
| urls = deque([user_url]) |
There was a problem hiding this comment.
We do not need a deque if get_emails() returns a list of emails.
There was a problem hiding this comment.
this get_emails() function doesn't return anything. It just add them to set ( to prevent same emails )
Co-authored-by: Christian Clauss <cclauss@me.com>
ghost
left a comment
There was a problem hiding this comment.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
ghost
left a comment
There was a problem hiding this comment.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
| """ | ||
|
|
||
|
|
||
| def getmails(num: int) -> None: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file web_programming/emails_from_url_alt.py, please provide doctest for the function getmails
ghost
left a comment
There was a problem hiding this comment.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
| """ | ||
|
|
||
|
|
||
| def getmails(num: int) -> None: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file web_programming/emails_from_url_alt.py, please provide doctest for the function getmails
|
I tried to make code as much simple as possible. I can also return the set ( to add doctest ) |
ghost
left a comment
There was a problem hiding this comment.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
| """ | ||
|
|
||
|
|
||
| def getmails(num: int) -> set: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file web_programming/emails_from_url_alt.py, please provide doctest for the function getmails
|
@cclauss I tried to create a doctest for it, but my code is dependant on sets which are declared in if __name__ == "__main__":Also, now the getmails function now returns set of emails |
| if __name__ == "__main__": | ||
| user_url = "https://google.com" # Example Url |
There was a problem hiding this comment.
Let's just replace all of __main__ with:
| if __name__ == "__main__": | |
| user_url = "https://google.com" # Example Url | |
| if __name__ == "__main__": | |
| print("\n".join(get_emails(["https://google.com"]))) |
There was a problem hiding this comment.
It takes num as argument. I tried to add url too , but didn't work the way i want, and also popleft is faster then pop(0) (if using list). So set would be faster.
ghost
left a comment
There was a problem hiding this comment.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
| """ | ||
|
|
||
|
|
||
| def getmails(num: int) -> list: |
There was a problem hiding this comment.
As there is no test file in this pull request nor any test function or class in the file web_programming/emails_from_url_alt.py, please provide doctest for the function getmails
|
@cclauss Been 8 days since i asked for review. Adding doctest is like changing the whole code. Also this is an alternative to the original code. Please look into it :) |
|
@cclauss Shall i close the pull request ? Since no action is being taken. I fulfilled most of the needs except |
|
No. Please leave it open. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions! |
Describe your change:
This version finds more email from the url and also find the urls from the given url and also find emails from them. It all depends on the range given by the user.
Checklist:
Fixes: #{$ISSUE_NO}.