Category Archives: Computer Stuff

No more Facebook

For a long time now, I’ve used Nutshellmail to stay on top of my social media. Rather than visiting a website fifty-seven times per hour only to find no interesting updates, I get an email a couple of times per day with just the new stuff. Instead of wasting hours on a website, I spend at most a few minutes. It’s an excellent solution.

However, Facebook doesn’t want excellent solutions. Nutshellmail explains (emphasis mine):

Upcoming Facebook Changes – April 30, 2015

Today, NutshellMail supports two types of Facebook connections: Profiles & Pages. (Your personal Facebook account is a Profile. Businesses, communities, and other non-personal entities on Facebook are Pages.)

Facebook Pages are not affected by the changes below — you’ll still see the latest posts, comments, and likes for your Page. No action is required.

Starting April 30, your personal Facebook Profile won’t be displayed as a connected account in NutshellMail email updates or in your NutshellMail account. Facebook has changed their policy and will stop providing this data to partners, so this affects all services that connect to Facebook, not just us! We wish they weren’t making this change, and we’re very sorry for the inconvenience.

Going forward, we’ll be improving the content we display from your Facebook Pages. For example, we recently added information about who views & interacts with your Page & posts.

Thanks for your understanding, and thanks for using NutshellMail!

Facebook wants me to waste hours on their website. Facebook wants me to consume updates through their algorithmically manipulated feed, and thus experience whatever manipulation they want to apply to me. Me getting updates efficiently and quickly through an external service doesn’t make me a good product, and so Facebook is shutting that avenue down in the hopes of forcing me back to their own site.

It’s not working.

Instead of becoming a good Facebook drone, I will simply stop checking it. I’ll miss all those updates. Because even under the best of circumstances, keeping up with Facebook manually is quite frankly boring. I can’t be bothered.

Friends who only communicate via Facebook: Sorry, I’ll only be occasionally updated on your doings from now on. I’ll be happy to meet you elsewhere, be it a different social medium or over a cup of coffee.

Companies who only advertise their products via Facebook: Sorry, you’ll be getting a lot less of my money from now on. Consider starting an email newsletter or something.

I’ll still be posting, or at least I will be until they decide to shut down whatever functions Buffer use.

Textile to Markdown in WordPress

It’s no secret that I’m a big fan of Textile, and much prefer Textile over Markdown. Yet I find myself working in Markdown all the time, because while you can find any number of helpful Markdown tools, the app selection for Textile is shit.

The syntax for the two is similar, but different in key points, and using both in different places means it’s easy for a tired brain to start typing in one in an environment that supports the other. For this reason I’ve decided to standardise on Markdown as much as possible1, and that includes converting my WordPress-based blog from Textile to Markdown.

Searching…

My first course of action is, of course, to search for a ready-made solution. A completely automated all-in-one conversion tool, just install a WordPress plugin and go!

I can find nothing suitable, or at least nothing suitable that has been updated in the last couple of years. I’m very wary of WordPress plugins that aren’t kept up-to-date; more than once such plugins have brought my network down hard. I’d rather not deal with the hassle.

On to the next solution.

The swiss army knife

I’m highly allergic to PowerPoint and Word gives me hives, so I’m already intimately familiar with pandoc for dealing with documents in all sorts of formats. Pandoc will happily eat Textile and shit Markdown, so there’s big job sorted.

This isn’t a very neat solution, mind you, as I have no automated way of getting the Textile out of WordPress and the Markdown back in. On the other hand, since I intentionally trashed the majority of my blog a few years back, I don’t have too many posts to edit. In other words: Fuck it, I’ll do that bit by hand.

So I copy out the contents of a couple of posts, paste it as text files, and shove it through pandoc. Success! Well, almost. There’s a couple of snags.

First is that I’m getting setext-style headers. I have to force atx-style headers.

Second is that my chosen Markdown implementation, Jetpack’s Markdown module, outputs a line break at every line break in the source. Standard Markdown only generates a line break at a blank line or a line ending in a double space. I have to force no wrapping in the output.

Third is that I’m getting a weird table syntax that pandoc loves, but is not at all supported by MarkdownExtra. I have to disable every table extension I don’t want to make sure I get the one syntax I can use.

Fourth and definitely worst, pandoc is forcing smart punctuation on me, and no amount of double-checking the spelling of --no-tex-ligatures will fix it. This is a pretty big problem, as it breaks any WordPress shortcode with attributes. Fuck sorting that out by hand. I’m going to need a serious replacement tool.

The chainsaw

I’m not familiar with any suitable replacement tools, so I ask cute boy his recommendation. His immediate response is sed. I grab the binaries and dependencies, open up the manual …

… and realise I have been handed a chainsaw for sharpening a pencil. Oh dear.

Since the manual fails at explaining even the basic invocation and even more so at providing some simple examples a poor newbie can work with, it’s time to go searching, testing, swearing, and searching some more.

An entirely unreasonable amount of time and Coke Zero later, I’ve managed to get a basic search and replace to work. I’m slowly drowning in temporary files that aren’t removed automatically, but it works, and I can move on to the task of matching the fancy Unicode punctuation riddling my files.

Further searching on this specific topic finally leads me to the UTF-8 encoding table and Unicode characters, and finally I can get this goddamned fucking shit to work properly.

Final touches

I’m almost there, but there’s still work to be done.

Pandoc’s conversion is not perfect. It randomly pukes out link syntax where there is no link, deletes a space here and there, and escapes underscores — even underscores in links. There’s no obvious pattern to this, so there’s only one solution left: Manual editing. A nice Markdown friendly editor does the job: MarkdownPad or MdCharm does it for me, but as already mentioned, there’s no shortage of good Markdown editors out there.

The final problem comes in the form of undocumented behaviour in Jetpack’s Markdown. The big one for me is that it doesn’t support tables without a header row. At all. Tables that don’t warrant a header row (or would be better with a header column) have to get one, because making shit up after a few hours of beating pandoc with a shovel and suddenly learning sed is the easiest task ever.

The result

So here’s the final workflow:

  1. Copy contents of post(s) to text files on local machine.
  2. Run batch script on text files to convert to Markdown and do some cleanups with sed.
  3. Do manual cleanup in a Markdown friendly editor.
  4. Copy Markdown output and paste back into each post.
  5. Pat self on head, because throat is sore from all the swearing, and I damn well deserve a pat.
REM Convert all *.txt files (containing Textile) in current folder to *.md (containing Markdown)
FOR %%i IN (*.txt) DO pandoc -f textile -t markdown-simple_tables-multiline_tables-grid_tables --atx-headers --no-wrap -o "%%~ni.md" "%%i"

REM Do all the replacements in the 'replacements' file to all *.md files
sed -i -f replacements *.md

REM Delete all the temporary files sed leaves behind
del sed*
# Left single quotation mark
s/\xe2\x80\x98/'/g

# Right single quotation mark
s/\xe2\x80\x99/'/g

# Left double quotation mark
s/\xe2\x80\x9c/"/g

# Right double quotation mark
s/\xe2\x80\x9d/"/g

# Horizontal ellipsis
s/\xe2\x80\xa6/.../g

# Em dash
s/\xe2\x80\x94/--/g

# <hr> to ---
s/<hr>/---\n/g

# Prettify lists
s/^-   /* /g

# Fix escaped dollar signs
s/\\\$/$/g

# Fix un-converted headers
s/^h1\. /# /g

# Fix stupid underscore fix
s/attachment\\_/attachment_/g

So that was fun, and I probably have to do it again for a couple of other sites in my network, since the Textile plugin was activated globally for … a few years. I’m already looking forward to it.


  1. Which means I’m going to start typing in Markdown at Obsidian Portal, and swear even more when I remember it’s the one place I have to use Textile. 

Support gymnastics, Tumblr edition

I keep a tumblr blog as a place to keep “cool stuff I found on the internet”. I’ve been filling it with stuff for over five years. It has the mish-mash of cat pictures, youtube videos, links and quotes that you would expect from such a blog. One day, completely out of the blue, it was suspended.

Saturday, 3rd November, 2012

I get an email from IFTTT notifying me that my Tumblr channel is offline. This has happened a couple of times before, so I see no reason to panic. It’s usually some minor issue that’s easily fixed, or just a temporary problem that will fix itself with some waiting.

IFTTT happens to be down for maintenance when I see the email, so nothing I can do at that very moment, anyway.

Sunday, 4th November, 2012

IFTTT is back up, so I pop in to reactivate the Tumblr channel. Not a problem, this should only take a minute. Log in, click big reactivate button, get redirected to Tumblr…

Your account has been suspended.
To find out why, please contact support.

Hum. That’s odd. I have no reason to assume this is not a mistake or glitch of some kind. There’s an email address provided, so I drop them a quick note — from the address associated with my account — asking what’s up.

Half an hour later, I get an email asking me what my email address is.

Oh dear.

Monday, 5th November, 2012

It’s been about 20 hours since I sent my initial email when I get a response. I suppose that’s pretty quick in support terms, but when you’re wondering what the hell is going on, it feels like an eternity.

We’ve terminated your Tumblr account at <blog address>. As per the policies you agreed to when creating a Tumblr account, we do not allow spam and/or affiliate marketing on Tumblr.

That’s the whole email. There’s no mention of where this spam and/or affiliate marketing was found, which means I am, quite frankly, stumped. I post cat pictures and funny videos, and I do so mostly to keep a repository for myself. I know the blog has some followers, but I couldn’t tell you how many if you held a gun to my head. I don’t even use a custom theme for this blog, but something pretty out of Tumblr’s own theme catalogue!

I email them back stating that I have never intentionally posted any kind of advertising, requesting some specifics on what I’m supposed to have done wrong, and asking if I can have a copy of the contents if they’re not willing to re-open my account.

Wednesday, 14th November, 2012

Still no response from Tumblr, so I drop them another email repeating my request.

One hour later

We’ve restored your content.

Thank you for bringing this problem to our attention. We’re sorry that it occurred, and we’ll do our best to make sure that it doesn’t happen again.

No mention of what bad about my account, but I have it back. I guess this means it helps to send some reminders if your account has been terminated in error…

Now, how do I back up my Tumblr blog? You know, just in case.

Summer holiday is go

Been there, done that. Comic by Busty Girl.

Due to work issues, cute boy and I didn’t get the easter holiday we wanted. This means I haven’t been anywhere in months and I am just about bouncing off the walls for lack of travelling.

Our summer holiday is now planned, so I won’t have to resort to drastic measures to stop the boredom. After our customary stop in England, our destination this summer is Budapest. Judging from my initial attempts to make a small travel dictionary, hungarian is the most, uhm, exciting language I’ve met so far. I will have to dig up some audio samples to figure out how spelling maps to pronunciation.

I’ve gotten a whole bunch of recommendations about where to eat and what to see while in Budapest (thanks, Espen & Hajni), and in trying to organise them I’ve run smack into a first-world problem. You would think that in this age of smart phones and tablets and WiFi and GPS everywhere, organising travel recommendations complete with maps, pictures, comments and clickable phone numbers would be a simple thing. That’s what I thought, at least. In reality there is a surprising lack of appropriate tools to do this.

In the past I’ve used Springpad for this sort of thing. It was never quite ideal, but it did provide room for the basics: Multiple pictures, address automatically placed on map, click-to-call phone numbers, links to official sites and reviews, notes and more notes. However, since my last holiday, Springpad has been “upgraded” to a Pinterest clone, and removed all the useful functions in the process. Addresses are no longer automatically mapped, or even linked to a map. The lovely notes are gone and replaced with social comments. I can still click the phone numbers, but really — I already have an address book on my phone. I don’t need a second one.

No, I’m not linking Springpad or Pinterest. Useless services do not deserve links.

So I’ve been looking for apps that all claim to help with this kind of planning. My most basic requirement is that I can enter data on my computer and access it on my Android phone/tablet (preferably offline), which disqualifies several Android-only or web-only solutions. I’ve gone through about a dozen apps fulfilling this basic requirement, and so far each and every one I’ve tried has the same problem: The app is for making recommendations, not organising recommendations you already have.

Stay.com is the only thing that comes even close to what I want: Its primary purpose is making recommendations, but it will let you enter your own locations. Stay.com’s recommendations come with a lot of information: Clickable address, map, pictures, clickable phone numbers, categories, price. Locations you enter yourself are not so lucky. You can input name and location, upload a single image, and place the location in a single category. Anything else will have to go in a free-form description field. No clickable phone numbers or links. On the plus side, you can download your personal city guide for offline use, and you can see all your saved locations on a single map. It’s the least bad solution around, so I’m keeping it while looking for something better.

Data that isn’t location-based, such as a travel dictionary, notes on culture, tourist traps to look out for, and similar things have no space in Stay.com, so I’ll still need another solution to complement it.

Ah well. I still have a few weeks to look, both for more recommendations and ways to organise them. Obsessing about the packing list should commence next week or so…