<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <id>https://www.rpatterson.net/</id>
  <title>Ross Patterson's Blog - Posts tagged Syndication</title>
  <updated>2025-07-14T00:00:48.910959+00:00</updated>
  <link href="https://www.rpatterson.net/"/>
  <link href="https://www.rpatterson.net/blog/tag/syndication/atom.xml" rel="self"/>
  <generator uri="https://ablog.readthedocs.io/" version="0.11.12">ABlog</generator>
  <entry>
    <id>https://www.rpatterson.net/blog/feeding-ablog-to-social-media/</id>
    <title>Feeding ABlog to Social Media</title>
    <updated>2021-03-22T00:00:00+00:00</updated>
    <author>
      <name>Ross Patterson</name>
    </author>
    <content type="html">&lt;section id="feeding-ablog-to-social-media"&gt;

&lt;blockquote&gt;
&lt;div&gt;&lt;p&gt;&lt;a class="reference external" href="https://twitter.com/nabobalis"&gt;&amp;#64;nabobalis&lt;/a&gt; released my contributions to &lt;a class="reference external" href="https://ablog.readthedocs.io/"&gt;ABlog&lt;/a&gt; to support automatic social
media posts for new posts.&lt;/p&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;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 &lt;a class="reference external" href="../migrating-from-plone-to-ablog/"&gt;I’ve just moved to a static site&lt;/a&gt; generated,
and hosted through an external service.&lt;/p&gt;
&lt;p&gt;I do like the “feeling” of &lt;a class="reference external" href="https://ifttt.com/"&gt;IFTTT&lt;/a&gt;, though there’s no basis for that, I’ve done no
research into their ethics and/or business practices.  They offer a &lt;a class="reference external" href="https://ifttt.com/feed"&gt;syndication feed
service&lt;/a&gt; and &lt;a class="reference external" href="https://ifttt.com/twitter"&gt;a tweet action&lt;/a&gt; so I started playing around with that.  Quick IFTTT
gotcha, the web and Android app UIs report no activity for &lt;em&gt;checking&lt;/em&gt; 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 &lt;a class="reference external" href="https://twitter.com/rosspatterson/status/1373017010985185283"&gt;the resulting tweet&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;The &lt;a class="reference external" href="https://ablog.readthedocs.io/manual/ablog-configuration-options/#blog-feeds"&gt;Atom feeds generated by ABlog&lt;/a&gt; didn’t include any Atom entry &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;category&lt;/span&gt;&lt;/code&gt; elements
so there was no representation of &lt;a class="reference external" href="https://ablog.readthedocs.io/manual/posting-and-listing/#posting-with-a-directive"&gt;the ABlog tags&lt;/a&gt; available in those feeds.  I
contributed &lt;a class="reference external" href="https://github.com/sunpy/ablog/pull/92"&gt;a PR to include category elements&lt;/a&gt; for ABlog tags.  A shout out to the
maintainer, &lt;a class="reference external" href="https://twitter.com/nabobalis"&gt;&amp;#64;nabobalis&lt;/a&gt;, 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
&lt;a class="reference external" href="https://ifttt.com/feed"&gt;syndication feed service&lt;/a&gt; only offers a small subset of &lt;a class="reference external" href="https://tools.ietf.org/html/rfc4287#section-4.2"&gt;the Atom entry data&lt;/a&gt;
so I can’t use the &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;category&lt;/span&gt;&lt;/code&gt; elements there at any rate.&lt;/p&gt;
&lt;p&gt;Thinking about the right place/level to support getting &lt;a class="reference external" href="https://ablog.readthedocs.io/"&gt;ABlog&lt;/a&gt; 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 &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;**/atom.xml&lt;/span&gt;&lt;/code&gt; feeds
which do a fine job for the original purposes of syndication feeds, but add
&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;**/social.xml&lt;/span&gt;&lt;/code&gt; feeds whose entry contents represents what should be in each tweet,
including hashtags.&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://www.sphinx-doc.org/en/master/templating.html#jinja-sphinx-templating-primer"&gt;Sphinx uses Jinja&lt;/a&gt; internally, so that’s what I used in a new &lt;a class="reference external" href="https://ablog.readthedocs.io/manual/ablog-configuration-options/#confval-blog_feed_templates"&gt;ABlog project
configuration option&lt;/a&gt;.  My &lt;a class="reference external" href="https://github.com/sunpy/ablog/pull/93#issue-597401522"&gt;feed templates PR&lt;/a&gt; was again promptly &lt;a class="reference external" href="https://ablog.readthedocs.io/release/ablog-v0.10-released/#ablog-v0-10-14-released"&gt;reviewed, merged
and released&lt;/a&gt; by &lt;a class="reference external" href="https://twitter.com/nabobalis"&gt;&amp;#64;nabobalis&lt;/a&gt;.  They even stepped in and fixed a CI issue exposed by
my changes for me!&lt;/p&gt;
&lt;p&gt;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…&lt;/p&gt;
&lt;/section&gt;
</content>
    <link href="https://www.rpatterson.net/blog/feeding-ablog-to-social-media/"/>
    <summary>@nabobalis released my contributions to ABlog to support automatic social
media posts for new posts.</summary>
    <category term="ABlog" label="ABlog"/>
    <category term="Atom" label="Atom"/>
    <category term="IFTTT" label="IFTTT"/>
    <category term="Syndication" label="Syndication"/>
    <published>2021-03-22T00:00:00+00:00</published>
  </entry>
</feed>
