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

Save output to path #68

Merged
merged 8 commits into from
Jun 4, 2022
Merged

Save output to path #68

merged 8 commits into from
Jun 4, 2022

Conversation

cgeopapa
Copy link
Contributor

Changed the behavior of -o and -s options. They now receive a path as an argument for the path to save the resulting file. JSON file is now updated with every new Google search. README.md is also updated to reflect these changes.

Example usage:
python pagodo.py -g dorks/all_google_dorks.txt -s ~/pagodo/results.txt -o ~/some_folder/pagodo_results.json

@opsdisk
Copy link
Owner

opsdisk commented Apr 14, 2022

Thanks for submitting a PR @cgeopapa - give me a few days to take a look at it.

@opsdisk
Copy link
Owner

opsdisk commented Apr 16, 2022

Hey @cgeopapa I just pushed some updates to the PR. I might have a few smaller tweaks, but it's mostly done.

  • I like your idea of being able to specify a path to save the files, but want to maintain the backwards functionality of auto-generating a file name if one isn't provided. If one is provided, like in your original examples, it will honor that.
  • When you moved the json file writer inside the loop, it won't save the completion_timestamp because the file will be saved before it's generated. If you have a really strong case for being able to monitor real time updates to a json file vs the text file, I can re-consider.
  • I want to still track the dorks/ directory so I removed that from .gitignore

Take it for a spin and let me know what you think.

@opsdisk
Copy link
Owner

opsdisk commented May 30, 2022

You ever get a chance to test the code @cgeopapa ?

pagodo.py Outdated
if self.save_urls_to_file is None:
self.save_urls_to_file = f"{self.base_file_name}.txt"

import ipdb;ipdb.set_trace()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line launches ipdb terminal and script does not continue execution. Specifically:

> /home/cgeo/Projects/pagodo/pagodo.py(135)__init__()
    134         # Assign log level.
--> 135         ROOT_LOGGER.setLevel((6 - self.verbosity) * 10)
    136 

ipdb> 

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@opsdisk opsdisk merged commit 1797384 into opsdisk:master Jun 4, 2022
@opsdisk
Copy link
Owner

opsdisk commented Jun 4, 2022

Thank you for the PR @cgeopapa!

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