Closed elstudio closed 11 years ago
I've added some notes to the diff, but beyond that, I'm not sure what the utility of such a function is?
If you wanted to list posts by id and url, I would prefer using some kind of standard output format, such as CSV or TSV, to play nicely with other unix tools.
Thanks for the comments -- the patch is much nicer for them.
Why a 'list' method? Since delete, edit and fetch all require a POST_ID, I needed a quick way of getting these POST_IDs. (In my case, I wanted to fetch all posts with a particular tag.) Copying them from the web browser window seemed tedious...
As for the output format, the patch now outputs as YAML. But I'm not sure that's the best way to go.
For scripting purposes, a list of POST_IDs would be best. But seeing the URL is very helpful for any manual use (like my purposes).
What do you think?
$ tumblr list --type=quote --host=cca.elstudio.us
39948369647: http://cca.elstudio.us/post/39948369647/please-just-do-this-if-you-do-nothing-else-git 39703564743: http://cca.elstudio.us/post/39703564743/think-about-what-other-features-are-missing-in-the
I'm getting this exception locally:
undefined method `y' for #<Tumblr::CommandLineInterface:0x007fcd8120bda8> (NoMethodError)
Not sure how the y
method is appearing on your load path. I think it might be better if you explicitly serialize the Hash to yaml and use ui_puts
or say
to write it to STDOUT.
I like YAML as the serialization format.
...and urls, optionally filtered by tag or post type.
Here's what the output looks like:
Or if you actually run the command you'll get something like this (provided you've got the correct authorization, etc):
Hope you'll find it helpful!