<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2012-02-18:1512618</id>
  <title>alexwlchan</title>
  <subtitle>alexwlchan</subtitle>
  <author>
    <name>alexwlchan</name>
  </author>
  <link rel="alternate" type="text/html" href="https://alexwlchan.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://alexwlchan.dreamwidth.org/data/atom"/>
  <updated>2019-02-27T20:03:56Z</updated>
  <dw:journal username="alexwlchan" type="personal"/>
  <entry>
    <id>tag:dreamwidth.org,2012-02-18:1512618:20342</id>
    <link rel="alternate" type="text/html" href="https://alexwlchan.dreamwidth.org/20342.html"/>
    <link rel="self" type="text/xml" href="https://alexwlchan.dreamwidth.org/data/atom/?itemid=20342"/>
    <title>$ python post_entry.py</title>
    <published>2019-02-27T20:03:23Z</published>
    <updated>2019-02-27T20:03:56Z</updated>
    <category term="non-venomous python"/>
    <category term="meta"/>
    <dw:security>public</dw:security>
    <dw:reply-count>3</dw:reply-count>
    <content type="html">&lt;p&gt;I continue to post regularly on Dreamwidth, so I&amp;#8217;ve extended &lt;a href="https://alexwlchan.dreamwidth.org/11682.html"&gt;my previous script&lt;/a&gt; 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.&lt;/p&gt;&lt;p&gt;Everything I&amp;#8217;ve posted in the last fortnight came through this script.&lt;/p&gt;&lt;p&gt;Code here if you&amp;#8217;re interested:&lt;/p&gt;&lt;p&gt;&lt;a href="https://github.com/alexwlchan/junkdrawer/blob/a2a5340a08d3c75f4caf31a89c4f9af2133eb6d4/services/dreamwidth/post_entry.py"&gt;https://github.com/alexwlchan/junkdrawer/blob/a2a5340a08d3c75f4caf31a89c4f9af2133eb6d4/services/dreamwidth/post_entry.py&lt;/a&gt;&lt;/p&gt;&lt;p&gt;There are some weirdnesses in how the API handles filters when posting an entry, so if you want to use it I&amp;#8217;d test it on something innocuous first. As usual, code is in the &amp;#8220;junk drawer&amp;#8221; repo because it&amp;#8217;s not especially well-documented, and provided more as a &amp;#8220;here is a useful starting point for your own script&amp;#8221;, not a finished article.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=alexwlchan&amp;ditemid=20342" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2012-02-18:1512618:14531</id>
    <link rel="alternate" type="text/html" href="https://alexwlchan.dreamwidth.org/14531.html"/>
    <link rel="self" type="text/xml" href="https://alexwlchan.dreamwidth.org/data/atom/?itemid=14531"/>
    <title>$ python backup_posts.py</title>
    <published>2019-02-10T10:03:30Z</published>
    <updated>2019-02-10T10:03:35Z</updated>
    <category term="non-venomous python"/>
    <category term="meta"/>
    <dw:security>public</dw:security>
    <dw:reply-count>1</dw:reply-count>
    <content type="html">&lt;p&gt;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&amp;rsquo;ve written.)&lt;/p&gt;&lt;p&gt;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).&lt;/p&gt;&lt;p&gt;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:&lt;/p&gt;&lt;p&gt;&lt;a href="https://github.com/alexwlchan/junkdrawer/blob/55b32a7896915c4d8a4246279a718e69dc61df8f/services/dreamwidth/backup_posts.py"&gt;https://github.com/alexwlchan/junkdrawer/blob/55b32a7896915c4d8a4246279a718e69dc61df8f/services/dreamwidth/backup_posts.py&lt;/a&gt;&lt;/p&gt;&lt;p&gt;(Usage instructions in the docstring; whole repo is MIT.)&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=alexwlchan&amp;ditemid=14531" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2012-02-18:1512618:11682</id>
    <link rel="alternate" type="text/html" href="https://alexwlchan.dreamwidth.org/11682.html"/>
    <link rel="self" type="text/xml" href="https://alexwlchan.dreamwidth.org/data/atom/?itemid=11682"/>
    <title>$ python markdownify.py</title>
    <published>2019-02-01T22:30:13Z</published>
    <updated>2019-02-01T22:30:32Z</updated>
    <category term="non-venomous python"/>
    <category term="meta"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;p&gt;I’ve been posting a lot more on Dreamwidth recently (although mostly private/filtered entries).&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;If Python is your thing and you'd find it useful, code available here:&lt;/p&gt;&lt;p&gt;&lt;a href="https://github.com/alexwlchan/junkdrawer/blob/b25c2d0cdeebab8b0335fc5717081b1154e0cf09/services/dreamwidth/markdownify.py"&gt;https://github.com/alexwlchan/junkdrawer/blob/b25c2d0cdeebab8b0335fc5717081b1154e0cf09/services/dreamwidth/markdownify.py&lt;/a&gt;&lt;/p&gt;&lt;p&gt;(Usage instructions in the docstring; whole repo is MIT.)&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=alexwlchan&amp;ditemid=11682" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
