Apr. 14th, 2017

jducoeur: (Default)

This week's been an interesting one. Not happy-making, by any means, but slightly less ulcer-inducing, not least for the omnipresent leaks that Steve Bannon may be out of favor with His Imperial Orangeness. So I shouldn't be surprised that Trump's core supporters are apparently beginning to freak out. From the sound of things, they are beginning to believe that -- the terrible truth dawns -- Donald Trump might not have been entirely honest with them!

The situation still sucks, and we need to keep the pressure up. But for now, I'm quietly enjoying the view of these assholes panicking because they aren't getting to destroy the country as efficiently as they want...

jducoeur: (Default)

In the comments from my previous post about cross-posting from Dreamwidth to FB and TW, [personal profile] laurion recommended trying Zapier. At the time, I said that it wasn't worth the effort -- that using Zapier in a straightforward way didn't produce any better results than dlvr.it, which is easier to use.

Problem is, that was basically accepting a mediocre solution, and the engineer in me rebelled. In particular, just judging from "likes" on FB, people are reading my direct status updates there, but most probably aren't actually following through to read the links. So what I really want is to repost the text of my post here over there. The only difficulty is that what you have available is either the raw HTML of the post (which looks like crap on FB), or the completely-stripped version (which drops all the links, formatting, and so on). Both are kind of ugly.

But the thing that makes Zapier so particularly interesting is that you can inject semi-arbitrary code into your pipelines -- it's pretty limited, but you can use both JavaScript and Python. And while I may hate JavaScript, I do know it modestly well. So I just spent an hour hacking up a stupid but adequate regular-expression engine that basically takes the HTML output from your RSS feed here, and turns it back into something vaguely like Markdown. Once I figured out the ins and outs, it wasn't terribly hard, and the results are exactly what I want: the text of my post as a decently readable and complete Status Update on Facebook, with the link to the original post here at the bottom.

Of course, there's a catch (which I didn't figure out until I had all of this working): Zapier's Free plan doesn't include "multi-step Zaps", and as far as I can tell you have to have multiple steps in order to make this work. And their Basic plan is insanely expensive for personal use ($20/month). My solution seems to be working, but I'm still in the "trial" period, and I suspect they're lying to me about the claim that I'm currently on the Free plan. I would bet that, during the trial, I'm secretly upgraded to a higher level, and once the trial is over, they'll tell me I can't use this Zap unless I pay them a fortune.

We'll see how it plays out: for now, I'm going to leave this solution working, but I'm prepared to go back to dlvr.it if this goes up in a puff of extremely-expensive smoke. For reference, in case anybody else wants to play with it, here's the JavaScript that I injected into my Zap to get it working.


jducoeur: (Default)

October 2017

123 4567
8910 1112 1314

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags