(DIR) Home
 (DIR) Blog posts
       
       Housekeeping
       
       14 March, 2025
       
       QUOTE
       This post was translated from HTML, inevitably some things will have changed or no longer apply - July 2025
       END QUOTE
       
       After moving this blog from AWS in North Virginia to a VPS run by Binary Lane in Australia, I've now also transferred the domain name from Porkbun in Oregon to Domeneshop in Norway, with the DNS handled there rather than on Cloudflare. After the usual interminable five day wait for the transfer that's going through now. Out of the US to Australia. Out of the US to Norway. Out of the US.
       
 (DIR) moving this blog from AWS
       I still need to move my e mail, & to think hard about various subscriptions, but this site at least's now entirely on the right side of the US border.
       
       For the longest time I believed the web would draw us all together. That seems hopelessly naive now. I didn't see the spider sitting in the middle of the web. Or worse than that, I did, but thought it was going to be benevolent.
       
       On a happier note, I've updated the footer links here to include my Codeberg repos, & started to work towards putting some of the Rust I've been writing up there. Just placeholders for now, but it's a start.
       
       In doing that I realised the OPML file I'd linked to here was quite out of date.
       
       With the help of Leon (AppleScript guru, amongst other things) my local copy of that file's now updated when I update this laptop, ready to be uploaded whenever I post. The AppleScript's the key to this working.
       
 (HTM) Leon
       CODE
       def date_string():
           now = datetime.datetime.now(datetime.UTC)
           return now.strftime("%Y-%m-%dT%H:%M:%SZ")
       
       def export_opml(ctx):
           content_dir = '/just/a/directory'
           opening = ('<?xml version="1.0" encoding="UTF-8"?>\n'
                      f'<!-- OPML exported {date_string()} -->\n'
                      '<opml version="1.1">\n'
                      '<head>\n'
                      '\t<title>Blogroll</title>\n'
                      '</head>\n'
                      '<body>')
           close = '</body>\n</opml>'
       
           apple_script = 'osascript -e \'tell application "NetNewsWire" to get opml representation of account "iCloud"\''
           result = ctx.run(apple_script, hide='out')
       
           if result.ok:
               ctx.run(f'cp {content_dir}/blogroll.opml {content_dir}/blogroll.opml.bak')
               with open(f'{content_dir}/blogroll.opml', 'wt') as f:
                   f.write(f'{opening}\n{result.stdout.rstrip()}\n{close}')
                   print('OPML exported')
           else:
               print('Error exporting OPML: ' + result.stderr)
       END CODE
       
       The export_opml function's called in the update task in the script, which is just an Invoke file.
       
       That Python's going to look pretty horrible on a phone, sorry. (More horrible.)