How to post to a test micro.blog from powershell
Sorry about the formatting of this post…I’m having trouble getting markdown not to convert the url to markdown links, even within code blocks
There’s a bit more detail on posting generally from powershell at mattypenny.micro.blog/2024/02/1…
This is the standard bit
$Token = 'whatever-the-token-is' | ConvertTo-SecureString -AsPlainText -Force
$Body = @{ content = 'Testing again. 1 , 2, 1, 2' h = 'entry' 'post-status' = 'draft' }
You then put ‘?mp-destination=’ followed by the URL of the test micro.blog on the end of the base URL as in the gist below. (The markdown conversion is nausing up the URL if I type it in here - sorry!
invoke-restmethod micro.blog/micropub -Method post -Authentication Bearer -Token $Token -Body $Body
url preview edit
mattypenny-test.micro.blog/2024/02/1… micro.blog/account/p… micro.blog/account/p…
The output confirms that the post has gone to mattypenny-test.micro.blog