At this time of writing, Posterous is an elegant, easy way to keep a blog. In 2011, I set up a simple blog to post articles I came across that had some angle on the interconnectedness of energy systems. I loved how I could simply send an email to <blog-name>@posterous.com and the article was posted.
However, Twitter bought Posterous as a modern way to hire their staff and then decided to shut Posterous down. All content will die end of April 2013. This is another hint that if you make something that lives online and there is a possibility you want to keep it, own the domain and be aware that you or someone you can ask for help needs to be able to curate the content over time (I started that blog just posting links, but then also wrote a summary or an opinion here or there - sometimes you don't know you'll want to keep something around for longer when you just started it).
Anyway - so I had to export the content from Posterous and import it into the MySQL database which currently underlines this website. Widely-used blogging software like Wordpress offers an importing tool, but everyone else is probably thinking how to get their Posterous data into their web publishing software.
Posterous offers an export in XML form, but it could have made it easier to deal with it. For instance, it is hardly parsable XML, and the creation date is in a format used in emails. It took me a bit to get a simple Python script working, and I thought I'd share it here for anyone who needs to do something similar:
Well, it seemed to work for the contents of my Posterous blog, at least. I only cared about title, content and creation date of each post.
Place the script above (download) into the folder you get from exporting your Posterous data (mine is called "space-3179959-energy-systems-ticker-0e4cc18feed3e8982ddae1ef4537b529") under the name of import.py (or whatever you like) and then call it via
Then, you should find a file called posterous-import.sql which you can use to populate your Posterous posts into your own (MySQL) database. I used BeautifulSoup to be able to parse the XML, so you'll have to install that python library first, e.g. by
pip install beautifulsoup4
Also, you probably first would edit the INSERT statement in line 35 to match your specific table structure which you're importing to.