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.
Add post to Ghost blog
-
@shaun-h Hi, I'm running Ghost 0.7.8 (on https) but I can't get it working with this workflow. Could you please give me (us) some information about the changes that you have made ? Thanks
-
@adana, I will have to take a look later for you to tell you want changes I made, it wasn't just a simple change from memory but I will let you know. I have updated mine to 0.7.9 and have got tags coming back from the API again not sure if this works in 0.7.8 though. I will test and document later for you but are you able to send me the error you are getting though? One thing to note is the guys writing Ghost have said the API is being heavily worked on at the moment so it might break again in a future update of Ghost.
-
@shaun-h Thanks for your reply ! I will update it tonight to 0.7.9 to match your version. I think it's an authentication issue. I tried without ssl but I have the same error : "Could not login to 'https://xxxxxxx.xxx/ghost/" Check Blog URL, Username, and password!" The token can't be recovered and the workflow ends. The API is active on ghost and I can get the token easily with developper tools in my browser. If you have a valid workflow, I'll have, at least, a working one for sure and I can move forward. I don't know if there is a way to see some logs (?). Thanks.
-
Here is a start, they added a client_secret token to auth so I defined a client_secret variable and change some code in get oauth token to include that in the post data
postdata = {'grant_type': 'password', 'username': workflow.get_variable('username'), 'password' : workflow.get_variable('password'), 'client_id' : 'ghost-admin', 'client_secret' : workflow.get_variable('client_secret')}
I think I used chrome developer tools to see the client secret when I logged in on a web browser and then set the variable with that. I don't have a computer handy to check for you.
I can't remember if that is all I did so let me know if that doesn't work. If that does I'll find the code I changed to get tags coming back as well.
-
@shaun-h It works, even on 0.7.8 ! Thank you very much ! I'm going to upgrade to 0.7.9 right now to be able, with your help, to get tags.
-
Ok so I changed in the update posts block, there is a script to get posts, I changed the response = requests.get line to be
response = requests.get(workflow.get_variable('url') + 'api/v0.1/posts?limit=40&status=all&staticPages=all&include=tags', headers=headers)
The API now has and include parameter for posts, for tags and author.
-
Thanks ! I have adapted the workflow and tested some update and everything seems to be fine.. with text only. If I try to update or upload a new post with some content like image link (generated with the workflow), or location data (generated from pythonista) in form of a map, I get a "Run Python Script": Line 40: ValueError: No JSON object could be decoded".
Doesn't work for now :
- Upload a new post with other content
- Update post with other content
Everything else is ok.
Any idea about where I should check ?
-
so I have another issue I forgot to mention, I downloaded the workflow again and made my changes I had to make a change to the prepare script I was getting and error about something not being hash able I changed
for tagid in taglist:
to
for tagidd in taglist: tagid = tagidd['id']
It got rid of the error not sure it has worked properly though, so I will debug tonight.
The error you are getting doesn't sound related, I tried with image data generated by the workflow and it worked.
Do you have an example of the location data for me to try? -
@shaun-h I have done my multiple tests with the same empty page since the beginning. But, just to be sure, i've opened a new one.. No json error anymore.. I don't know why.. Maybe something hidden somewhere.. Your
modification for the tagid has solved the update process. Everything is ok now ! A big thank you for your help !Did you try to contact the author of the original workflow ? Maybe you can upload your "revision". This will probably help other people even if there is modifications in the near future on the "Ghost" side.
Now, I'm just waiting for the next update of Editorial who, I hope, solved the issue with the location on iOS 9. (That's why I use pythonista to get the location information).
Thanks !
-
Perfect way to avoid spammer attacks on your Instagram account is to get an app https://spamguardapp.com/. It'll delete all the unwanted followers from your account.