alexwlchan: (Default)

I continue to post regularly on Dreamwidth, so I’ve extended my previous script for turning Markdown into Dreamwidth HTML, and written another script that asks me a few questions about filters and title, then posts the entry for me.

Everything I’ve posted in the last fortnight came through this script.

Code here if you’re interested:

https://github.com/alexwlchan/junkdrawer/blob/a2a5340a08d3c75f4caf31a89c4f9af2133eb6d4/services/dreamwidth/post_entry.py

There are some weirdnesses in how the API handles filters when posting an entry, so if you want to use it I’d test it on something innocuous first. As usual, code is in the “junk drawer” repo because it’s not especially well-documented, and provided more as a “here is a useful starting point for your own script”, not a finished article.

alexwlchan: (Default)

Now I'm posting more on Dreamwidth, I want a way to keep an offline copy of everything I've written here. (I am almost hoarder-like in my desire to keep copies of everything I’ve written.)

Hooray for sites with sensible APIs! Dreamwidth has an XML-RPC API, so I've written a short script that grabs a copy of all my posts. It saves a JSON file with all the data from the API, and an HTML file for convenience (and grep).

If Python is your thing and you'd find it useful (or just want another example of using the Dreamwidth API), code is on GitHub:

https://github.com/alexwlchan/junkdrawer/blob/55b32a7896915c4d8a4246279a718e69dc61df8f/services/dreamwidth/backup_posts.py

(Usage instructions in the docstring; whole repo is MIT.)

alexwlchan: (Default)

I’ve been posting a lot more on Dreamwidth recently (although mostly private/filtered entries).

I've written a short script that lets me write posts in Markdown, then just upload the finished HTML to the Dreamwidth post editor. I find Markdown easier to write.

If Python is your thing and you'd find it useful, code available here:

https://github.com/alexwlchan/junkdrawer/blob/b25c2d0cdeebab8b0335fc5717081b1154e0cf09/services/dreamwidth/markdownify.py

(Usage instructions in the docstring; whole repo is MIT.)

Profile

alexwlchan: (Default)
alexwlchan

February 2019

S M T W T F S
      12
3456789
10111213141516
17181920212223
242526 2728  

Syndicate

RSS Atom

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 14th, 2025 10:38 am
Powered by Dreamwidth Studios