Feeding ABlog to Social Media

@nabobalis released my contributions to ABlog to support automatic social media posts for new posts.

I started evaluating how to automate posting new blog posts to social media. There are tons of services for doing this from syndication feeds, and some of them even have a limited “freemium” level, but the whole “social marketing” thing makes my skin crawl (even if that’s essentially what I am trying to accomplish here) and I didn’t want to have to think about those limits. I went looking for more “open” solutions though an external service. I still want to use an external service just because doing something self-hosted seems overkill especially after I’ve just moved to a static site generated, and hosted through an external service.

I do like the “feeling” of IFTTT, though there’s no basis for that, I’ve done no research into their ethics and/or business practices. They offer a syndication feed service and a tweet action so I started playing around with that. Quick IFTTT gotcha, the web and Android app UIs report no activity for checking the feed, only once a new entry has been found in the feed. I wasted some time trying to figure out why it wasn’t checking my feed before I’d made a new post. Beyond that it was dead simple to get working but the resulting tweet wasn’t so great. The broken image is easy to fix just by changing the IFTTT action to the one without an image, but the lack of hashtags is a larger problem.

The Atom feeds generated by ABlog didn’t include any Atom entry category elements so there was no representation of the ABlog tags available in those feeds. I contributed a PR to include category elements for ABlog tags. A shout out to the maintainer, @nabobalis, for being Johnny on the spot reviewing and merging my PRs quickly and without much fuss! That was a quick and easy contribution but the IFTTT syndication feed service only offers a small subset of the Atom entry data so I can’t use the category elements there at any rate.

Thinking about the right place/level to support getting ABlog post tags into tweet hashtags, I figured the best way to define the problem is as external services using syndication feeds as a sort of API to content. I can imagine many more such cases where external services support only a small subset of Atom feed entry data, or are very opinionated or inflexible about whats in the entry content, etc.. So I decided the best way to support as many of these use cases as reasonable was to generating multiple Atom feeds with support for using templates to render the values for the appropriate entry elements for each feed. As such, I could keep the default ABlog **/atom.xml feeds which do a fine job for the original purposes of syndication feeds, but add **/social.xml feeds whose entry contents represents what should be in each tweet, including hashtags.

Sphinx uses Jinja internally, so that’s what I used in a new ABlog project configuration option. My feed templates PR was again promptly reviewed, merged and released by @nabobalis. They even stepped in and fixed a CI issue exposed by my changes for me!

I’d act surprised that I managed to turn something like this into a minor software project, but that would be lying. ;-) I wonder how the tweet for this post will look…

Comments

comments powered by Disqus