passivetotal/python_api

Formatting errors pt-client

Closed this issue · 2 comments

magoo commented

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

This doesn't look implemented.

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