Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Total Newb Question: Use Tumblr API Through Pythonista?
-
I want to use Pythonista to automate reblogging from one of my tumblr blogs to another (they're my kids' sites that I set up for my parents. When I have a blog that features both of them I want it to be reblogged automatically based on a tag).
I want to either have a script that looks for all recent posts and checks to see which ones haven't been reblogged yet and then reblog them, or have one that simply reblogs the most recent post (doesn't need to use a special tag). The second one being easiest and not requiring the storing of data in some kind of database, but the first one would be BY FAR my preferred solution.
This Python Tumblr REST library exists: https://github.com/tumblr/pytumblr
Would it be possible to load the four or five scripts from this open source project into Pythonista and then use it to make REST calls to Tumblr from a script? Preferably this would be automated with Workflow.app or just as a shortcut on the App Launcher or something. I'm asking before I dive in and buy Pythonista.
Thanks!
-
This should be possible. It's relatively easy to install third-party libraries in Pythonista (as long as they don't contain any C/Fortran/whatever code - the library you linked to does not). Pythonista has no built-in functionality for this, however there is the excellent Unix shell clone stash which you can use to install libraries, either automatically from PyPI or manually by downloading and extracting the source archive.
-
@tyehill the answer to your question is YES! As @dgelessus points out you shouldn't have a problem installing this.
To answer the other part of your question, you CAN have a shortcut in the app launcher. (You could potentially do that through workflow too (but that's an extra unnecessary step that would be the slowest way to launch).
Options:
A: After you have your script, use this tool to create a home screen shortcut.
http://omz-software.com/pythonista/shortcut/B: Alternatively you could use the Xcode template to create truly standalone apps https://github.com/omz/PythonistaAppTemplate
C: Alternatively you could use something like Launch Center Pro to organize all sorts of quick actions, including links to specific scripts.
(http://contrast.co/launch-center-pro/) -
Following up:
@dgelessus could you elaborate how to install using Stash from a github page?
using StaSh,
pip install pytumblr
yields "no package found with that name" The same command works on OS X however.note, @tyehill that this doesn't mean you can't install it, just that pip in StaSh doesn't seem to have this package in its index.
-
@Tizzy StaSh pip is case sensitive, so you need to run
pip install PyTumblr
You can install from a github repo with
pip install OWNER/REPO
, e.g.pip install tumblr/pytumblr
. Note this requires the latest stash.One thing to note is that PyTumblr requires httpretty. The latest stash pip can handle dependencies and will install httpretty automatically. Httpretty does not depend on any other packages but its setup file is not well written and declares a dependency as
#HTTPrettydoesn'thaveanyrequirementspersesofar.yay!
. An error will be generated as pip cannot find this dependency which can be safely ignored. -
Thanks for all the great replies! I'm going to go ahead and buy it and dive right in. I'll probably end up having loads of other questions and whatnot and will visit this forum often.