davidchambers / tutor

JavaScript interface for the Gatherer card database
https://gatherer.wizards.com/
Do What The F*ck You Want To Public License
149 stars 18 forks source link

CLI/API discrepancies & Lack of documentation #77

Closed bensquire closed 11 years ago

bensquire commented 11 years ago

Hi All,

I see the project is coming along very nicely.. I've been trying out the CLI but notice I don't seem to be able to get a list of sets, formats, types etc. Does the CLI not reflect the API? When running the python script from the wiki (bin and py script in the same folder) all I see get is, could this be related?

DEBUG:root:searching for sets
Traceback (most recent call last):
  File "test.py", line 62, in <module>
    write_all_cards_from_gatherer_to_file()
  File "test.py", line 51, in write_all_cards_from_gatherer_to_file
    all_sets = _query_tutor_for_all_sets()
  File "test.py", line 44, in _query_tutor_for_all_sets
    return _query_tutor(['sets'])
  File "test.py", line 28, in _query_tutor
    u' '.join(command))
subprocess.CalledProcessError

Sorry for the barrage of questions, but as I'm new to node and because the lack of documentation I'm finding it difficult to work through.

Thanks in advance Ben

davidchambers commented 11 years ago

If you use the current master, you'll have access to the following:

$ bin/tutor formats
$ bin/tutor formats --format json
$ bin/tutor sets
$ bin/tutor sets --format json
$ bin/tutor types
$ bin/tutor types --format json

The fact that the most recent version of Tutor on npm doesn't include these commands suggests we're overdue for a release.

bensquire commented 11 years ago

Your right I was using the version from tutor... I'll see if I can build a version from the current master, thanks!

robdennis commented 11 years ago

even with the latest checkout, I'd expect some problems running the example script verbatim due to #69

edit: I take it back, I just reran my version of the script and think that #74 may have ended up addressing #69 since redirects aren't being explicitly not-followed