August 21, 2016

Do-It-Yourself: Auto-Posting Inspirational Quotes on Twitter and Facebook

I enjoy reading quotes, concise and thoughtful ones, as IT workaholics like me are busy and quotes are easy to be consumed; they get me inspired quickly or start off the day with clarity.

To pay my respect and contribute, I wrote a few Windows and Linux scripts (documented below) and established these quote delivery services on Twitter and Facebook in February 2011:

This blog post describes the previous and current designs of the services as well as sharing the scripts written to implement them. Unlike the last post regarding social media automation which introduced paid services that are more user-friendly, this post demonstrates a more advanced technique; it is completely free of charge, but could be more friendly to system admins or IT pros than general users.

Flow – How It Works


Every day, a quote-sending script is run on a schedule using Task Scheduler (Windows) or cron (Linux) to compose a tweet (or a blog post for the earlier version) containing a quote taken from a text file (database) which in turn gets synchronized to multiple social media platforms using various free third-party web services.

Synchronization with Twitter, Facebook, and Blogger

Thanks to free and readily available cloud-based/on-premises social media automation tools, there is no need to code much. The previous implementation made use of GoogleCL, an open-source cross-platform command-line utility which supported posting to Google services such as Blogger, while the final destinations, Twitter and Facebook, were synchronized with Blogger posts with help from other services such as FeedBurner Socialize and the built-in Facebook synchronization support of Twitter. By doing so, posting once on Blogger automatically posted on Twitter and Facebook, achieving automated synchronization across the three services.

Flow – Previous Implementation


  • Script (GoogleCL) > Blogger > FeedBurner > Twitter > Facebook sync of Twitter > Facebook

Script Download – Previous Implementation (Windows)

Script Download – Previous Implementation (Linux)

However, things in the cloud change too fast. Some time ago, GoogleCL, the base of the script, stopped working due to a change in the Open Authentication (OAuth) mechanism from Google's side.

After the change, the current implementation make use of twt.exe, a Windows-based command-line tweeting utility to tweet first (thankfully a lot of good quotes are within the character limit imposed by Twitter) and then synchronize content with Blogger and Facebook using an IFTTT recipe called “New Tweet to Blogger” and the native Facebook synchronization of Twitter respectively.

Flow – Current Implementation


  • Script (twt.exe) > Tweet > IFTTT recipe: “New Tweet to Blogger” > Blogger
  • Script (twt.exe) > Tweet > Facebook sync of Twitter > Facebook

Script Download – Current Implementation (Windows)


While there are GoogleCL alternatives like twt.exe and the native mail-to-blog function of Blogger (used with a command-line email client such as blat.exe) which allowed the quote services to resume, GoogleCL was irreplaceable in that it was more feature-rich. For example, it supported tags (turned into hashtags on Twitter and Facebook) which allow more granular categorization of posts, which is unsupported by the other approaches.

If you love quotes like I do, you may now build your own service with quotes you love with the above script and approach. Consider turning on Twitter mobile notification to have the quotes instantly pushed to your devices to (hopefully) get you inspired. Feel free to share your ideas with me by leaving a comment.


No comments :

Post a Comment