-
-
Save manton/952580bb1e6a60e9f3930cb1882f0a04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get latest Micro.blog photo | |
let token = "" // set this to a token for Drummer added under Account→ "App tokens" | |
let blog_url = "" // optional, your blog URL if you have multiple hosted blogs | |
let s = http.readUrl("https://micro.blog/micropub/media?q=source&access_token=" + token + "&mp-destination=" + blog_url) | |
const obj = JSON.parse(s) | |
dialog.alert(obj.items[0].url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was super helpful! I cobbled together from another users scripts these extra two lines replaces your last one. It will then automatically add the last Micro.blog image into the attributes automatically for an inlineImage. The dialog box could be dropped on mine too but I like the feedback.
op.attributes.setOne("inlineImage", obj.items[0].url);
dialog.alert("Image Added")