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

JSON output to console #169

Open
tlansec opened this issue Apr 27, 2022 · 0 comments
Open

JSON output to console #169

tlansec opened this issue Apr 27, 2022 · 0 comments

Comments

@tlansec
Copy link

tlansec commented Apr 27, 2022

I considered doing this as a PR but I'm not sure whether:

  1. It would be accepted
  2. How best to do this while retaining the colouring // style of other output types

Essentially for both the search and host command I think it would be useful to be able to just immediately print the JSON to the console so that it could be read // manipulated via jq, e.g.

shodan host 1.2.3.4 --format json | jq <some jq syntax>

Would something like this be acceptable?

def host_print_json(host, history=False):
    click.echo(json.dumps(host['data'], sort_keys=True, indent=4))
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

No branches or pull requests

1 participant