Now You Can Crosspost to Twitter!

Feature requests have been coming in with a greater frequency lately, and it's great to see people actively help guide the development of 10Centuries. One of the commonly requested functions has been for a tool that would allow posts from 10Centuries to get posted over on Twitter (and other social networks). Well, I'm happy to say that crossposting to Twitter is not only possible, but slick as heck1.

Before explaining how to set it up, let's look at what posts will get sent over and how.

Social Posts

Social posts can be crossposted at the same time as they appear in the 10Centuries timelines, meaning you don't have to wait until some arbitrary time for posts to be dumped from 10Centuries to Twitter in a batch process that spams everyone who follows you. Instead, you control the rate of speed that posts are sent over. When posts are longer than 140 characters, they'll be trimmed down in as logical a manner as possible2, and a link to the full post will be attached to the end, allowing people on Twitter to follow the link and read your entire thought.

But there is one caveat: posts mentioning accounts (real or imagined) will not be sent to Twitter. This is to prevent incorrect accounts from being mentioned in posts. While it's certainly possible to have fancy translations in effect that would change all references of to @matigo_ca, this would break as soon as a post mentioning someone who hasn't attached their Twitter account — if they even have one — is made. So, just as requested, only social posts without mentions will be sent over.

New Blog Post / Podcast Notifications

When a new blog post or podcast is published, it's important that people can come see it. So these posts will have notifications sent over to Twitter as they go live3 so long as the publication date is within the last 7 days. This means that if you write a post and back-date it to yesterday, a "New Post!" notification will still be sent out to Twitter. If the post is backdated to last month, then one can probably assume that you do not want or need people knowing about it. If this is incorrect, my apologies, but this is done to prevent people's Twitter accounts from being overrun with notifications on data imports and other common data migration processes. Of course, future-dated posts will not have notifications sent until the posts are life for publication.

Posts that are marked as invisible, password-protected, private, or on a password-protected site will not have notifications sent.

One of the next features that will be built into all of the themes is a proper Twitter Card, allowing for rich content views to appear in the timelines. Hopefully this will be ready before too long.

How to Set Up Twitter on 10Centuries

From the Administration screens, click the little wrench icon on the left — for Settings — and choose "Post to Twitter". You should see something that looks like this:

Step One - Connect

From here, press the "Connect" button and go through the standard Twitter sign in process. 10Centuries will need permission to write to your timeline, but this is all 10Centuries will do. Your Tweets, Follower/Following information, and other details are left alone because they are not necessary for 10Centuries to do its job. For those who are interested, 10C uses only two API endpoints when connecting to your Twitter account:

  • statuses/update ⇢ to write Tweets
  • account/verify_credentials ⇢ to get some account details letting 10C show you which account is connected

Once connected, you'll be able to specify whether new blog post / podcast notifications should be sent, and which websites you'd like to have notifications sent for, as well as whether you'd like social posts that don't mention accounts to be crossposted.

Step Two - You're Connected

Items are set in clear "Yes" / "No" values, and everything defaults to "No" because that just makes sense. If you add new websites to your account in the future, be sure to head back to this screen to let all of your followers on Twitter know about new posts.

Questions, comments, concerns, or feedback? Just get in touch :)

  1. Well … in my personal opinion, anyway.

  2. The code tries really hard to not split a word in half.

  3. The database is checked every minute.