passivetotal / python_api

Python abstract API for PassiveTotal services in the form of libraries and command line utilities.
http://passivetotal.readthedocs.org/en/latest/index.html
Other
85 stars 28 forks source link

Formatting errors pt-client #13

Closed magoo closed 8 years ago

magoo commented 8 years ago

pt-client without --format works just fine

$ pt-client pdns --query passivetotal.org
{
    "results": [
        {

Any formatting causes this error:

$ pt-client pdns --query passivetotal.org --format=text
Traceback (most recent call last):
  File "/usr/local/bin/pt-client", line 9, in <module>
    load_entry_point('passivetotal==1.0.30', 'console_scripts', 'pt-client')()
  File "/Library/Python/2.7/site-packages/passivetotal-1.0.30-py2.7.egg/passivetotal/cli/client.py", line 268, in main
    output = write_output(data, args)
  File "/Library/Python/2.7/site-packages/passivetotal-1.0.30-py2.7.egg/passivetotal/cli/client.py", line 159, in write_output
    data = [getattr(data, arguments.format)]
UnboundLocalError: local variable 'data' referenced before assignment

OSX El Cap, Python 2.7.10, cloned from GH and used setup.py

magoo commented 8 years ago

This doesn't look implemented.

ok2play commented 5 years ago

Same?

Clean Kali Linux VM

sudo apt update -y && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y

The PassiveTotal library provides several different ways to interact with data. The easiest way to get started with the API is to use our built-in command line interface. Once installed, queries can be run directly from the command line with no need to write code or make any configuration changes.

  1. Install the library using pip or the local setup file: pip install passivetotal
  2. Copy the API key from your PassiveTotal account
  3. Use the pt-config tool to set your API key: pt-config setup
  4. Grab some passive DNS data: pt-client pdns --query www.passivetotal.org --sources=pingly --format=table

Traceback (most recent call last): File "/usr/local/bin/pt-client", line 10, in sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/passivetotal/cli/client.py", line 268, in main output = write_output(data, args) File "/usr/local/lib/python2.7/dist-packages/passivetotal/cli/client.py", line 159, in write_output data = [getattr(data, arguments.format)] UnboundLocalError: local variable 'data' referenced before assignment