Customizing Daily Links Post

Few days back, I wrote about setting up daily blog posting schedule for your Delicious links to keep your blog active and to share interesting links that your blog readers might otherwise miss. Several bloggers including Dina and Maitri either do or used to implement this feature. Some bloggers choose to display their Delicious links in the sidebar or on a separate page but experience tells me that since these links do not go in your feed, they are soon ignored or never even seen by most readers. If some readers want a bookmarks-free feed, you can always assign your bookmarks post to only one category, like I do, and create a customized feed with that category excluded.

The delicious daily blog posting feature is extremely limited and almost un-customizable. You can neither edit the post titles nor style your links. Tags are included by default and add clutter not to mention distraction, from the main link. Also, all except private links are streamed into the daily blog posting. Also, nowadays lots of link sharing happens on Twitter and you want to capture those links too (Pinboard does).

WordPress is extremely flexible and like “there is an app for that”, there is a plugin for that too. I found Postalicious, an awesome plugin that customizes almost everything about the process.

It is based on the pseudo-cron functionality introduced in WordPress 2.1 to schedule automatic hourly updates with the help of the SimplePie Core plugin. After activating the plugin, you only need to set up your preferences and then click on either the “Activate Hourly Updates” or “Update Now” buttons. “Activate Daily Updates” will schedule automatic updates every hour and fetch any new bookmarks you have added. The “Update Now” button retrieves any new bookmarks found when you click it [source]

Import Options

Screen shot 2010-01-29 at 2.29.11 PM.png

As you see in the screenshot, Postalicious lets you extract links from several sources including Delicious. Since I switched to Pinboard last week, I choose the Yahoo Pipes option, which the plugin author tells me, will work for any RSS feed but if you are inclined, you can also use the power of Pipes to modify your incoming content. I also use the feed for the tag ‘pb’ so that I can choose which links I want to share on my blog (hence the #pb links you see on my tweets). All I have to do is to include the ‘pb’ tag (can be anything) along with other tags when I bookmark the link at Pinboard.

Specifying Options

Screen shot 2010-01-29 at 2.38.40 PM.png

[click image to enlarge] The Options feature is when Postalicious shines. You can specify not only the number of bookmarks you need to create a post but also at what time you want it to be posted. I hate to publish a post with merely 2-3 links and I rather wait to publish until the end of the day so as to capture all my links for the day. One of the impressive features of the plugin is that if the post is not ready for publication, Postalicious creates a draft with the pending bookmarks which you can publish any time or wait for Postalicious to publish it when it meets your publishing settings. It creates a draft as soon as it detects new bookmarks, schedules the post as soon as it hits the minimum bookmarks target, keeps adding links to the scheduled post with every hourly update, and then publishes the post at the specified time. If there aren’t sufficient bookmarks in a day to meet your minimum mark then it collates the links over a period of time. If you keep the maximum number of bookmarks as zero then Postalicious keeps adding new bookmarks to either your draft or your published post depending upon your settings. If you specify an upper limit, then it simply creates a new post.

Styling Post Templates

Screen shot 2010-01-29 at 2.58.09 PM.png

[click image to enlarge] Another important feature over the Delicious counterpart is the ability to style your posts. You can specify not only the post titles but also use CSS to change how the bookmarks are displayed. Postalicious offers several default placeholder values that you can enter for displaying certain fields like date, title, and description. If you are displaying excerpts, you can even specify the generic contents of the excerpts that accompany your link posts.

Minor Customization

Now for the minor quibbles. For some unknown reason, the plugin acted a bit weird on my blog. The hourly updates worked just fine. Even the draft was created with the bookmarks it extracted from the feed but as soon as the minimum bookmarks target was reached, it published the post ahead of schedule. Several emails with Pablo Gomez, the plugin author who was thankfully extremely responsive, later, we figured out a fix. I edited the plugin file to change the updates to daily instead of hourly. This also meant lesser load on the server and it fixed my problem. If you too want to change the update frequency, simply deactivate hourly updates, go to wp_postalicious.php in the wp-content/plugins folder and replace line 166 which should read:

wp_schedule_event($crontime, 'hourly', 'nd_hourly_update');

with:

wp_schedule_event($crontime, 'daily', 'nd_hourly_update');

and then just reactivate the automatic updates. Notice that Postalicious will still say “hourly” everywhere, but the updates should be daily after this change.

But you still don’t know at what time exactly in the day it will trigger the update. If you want the daily updates to happen at a particular time, say 11:30pm, then deactivate the hourly updates and make the following changes again to the wp_postalicious.php file in the lines just above the code mentioned above:

$crontime = time() + 120;
// Set the time to the next hour.

// $crontime += (60 - date('i',$crontime))*60 - date('s',$crontime);

Pablo tells me, the two-minute buffer (120) is to avoid WordPress going crazy by trying to immediately update after saving the plugin file. Now reactivate the ‘hourly updates’ only at the time you want it to check it daily. So if you do it at 11:15pm, then the updates will happen daily at 11:17pm. Be sure to set the time of publishing after this time, say at 11:30pm. Otherwise your bookmarks for the day will be published the next day. If everything goes according to plan then, bookmarks will be imported and a post with your bookmarks will be created for publication at your set time. Strangely, my problem with the hourly updates did not repeat with the daily updates fix and it duly created a scheduled post ready for publication instead of publishing it right away.

If you are an avid bookmarker and a lapsed blogger, this plugin will keep your blog alive. Happy linking.