Saturday, May 22, 2010

Fixing your feed part 2

Update: This report is obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

English-language syntax is tricky, and the Short pipe does a number of little tricky things to compensate. Even so, the generic replacement rules sometimes run into an exception that screws things up.

For instance, my pipe was evaluating the text string "U.S." as a place that needed a line break after the first period.

Why? The Short Feed pipe evaluates any period followed by letter with no intervening space as the end of a paragraph, in need of some line returns. (The Full pipe does not do this.)

I could have edited the post where I originally wrote "U.S." to be simply "US," but that would have been incorrect usage and I am fussy about that sort of thing. So I wrote an exception into the pipe.

I will show you what I did so that you can write simple exceptions too. (For example, you might write about time and say "11:30 A.M.") As a first step, you must go to your pipe and click Edit.

Fixing your feed part 1

Update: This report is obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

For Short feeds only.

I built the Short pipe for this hack to work on blog feeds that have been limited to the first 255 characters or so. It assumes no more than nine paragraphs or so.

That should be plenty if you set your feed options to "short."

Friday, May 21, 2010

Still missing some line returns?

Update: This report is obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

If you are still getting run-together paragraphs and have the Short feed, there are two possible causes. (If yours is Full, or if you are just building a list of blog-post titles, you are done! Go here.)

Missing line returns and trailing spaces

Update: This report is obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

You can skip this step if you are using a Full or Jump-Break feed or if all you are publishing is a list of post titles.

Otherwise:

Your thirst to present your blog content in chronological order has led you to publish a feed of your blog and run it through a pipe, then make a second feed from that and convert it to a script that you publish on your blog.

Thursday, May 20, 2010

Format feed with CSS

Update: This report is part of a bigger topic that is obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

To format, or not to format?

If you are using my blog-journey hack to put your blog in chronological order, one of the things I explain how to do is to format the results.

You could, for instance, try to make your reordered version look as much like a series of regular blog posts as possible, by copying the formatting for blog-post titles and text.

Stylin' your blog-post-order hack (part 2)

Update: This report is obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

As I try to explain in part 1, the code that structures your blog ("This is a blog post" "This is a heading" etc.) has to be associated with style definitions that are elsewhere. In this case, "elsewhere" is in the template for your blog.

We'll be adding new style definitions to your template but not changing any existing ones. First, however, we have to tag your hack so as to associate it with the new formatting.

Return to the static blog page where you pasted your script and open it in the html editor.

The actual script is included inside a <script.../script> tag. To tag that for formatting, put it between the following tags:
<span class="rss-journey"> [<script.../script>] </span>
where [<script.../script>] refers to the first part of what you've already pasted.

Publish this. There will be no change yet, but the span class now allows you to format the feed your script is rendering on that page.

The code that will format your css looks something like this:

Stylin' your blog-post-order hack (part 1)

Update: This report is obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

You've jumped through all the hoops to get your blog content listed in order, oldest first, on your blog: feed, pipes, javascript, and back on a static page on your blog.

Congratulations!

The next part of the hack uses cascading style sheets to format how your feed looks.

Are you satisfied with your formatting? If so, skip this step and go here. (If you're not sure, maybe this will help you think about whether to tweak the formatting.)

Otherwise, prepare yourself for a peek under your blog's hood.

The script puts the feed in your blog

Update: This report is obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

This is the script
that displays the feed
that comes out of the pipe
that mashes the feed
that you publish of your blog
to install the blog-journey hack.

Specifically, the code you got from feed2js (or similar service) will show your feed on a web page, on any browser that supports javascript.

I recommend that you put your feed on a static blog page, not in a blog post where it could cause some problems. The feed is potentially big and will slow down your blog (and eat up your page-size quota) if you put it in a post.

From feed to script

Update: This report is largely obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

Blogger is stubborn about blog-post order. Last things first, on the theory that blog readers are not interested in what you said yesterday.

Fortunately, Blogger has been flexible about allowing bloggers to post their own scripts in the javascript language in their blogs.

What this means is that you can show your blog content as a journey, in first-first chronological order, if you are willing to jump through a few hoops: publish as a feed, squirt the feed through Pipes, and convert the feed of that to a script.

feed2js.org is one of several web-based services that convert feeds to scripts that you can just paste onto a blog or other web page. The script will then display the feed. (Formatting is another matter.)

You will be using feed2js's "build" page. Take the feed url from the result of your pipe (with an "http:" at the beginning) and paste it into the "feed url" box on that page.

Then review the options for the feed.

Segmenting your blog-journey by date

Update: This report is largely obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

Especially if you have many posts in your feed, you might want to break your blog journey into chunks by date.

You could, for instance, have each year of posts on a separate page, or break up the flow by month or year. "May" followed by "June," etc.

You may also discover--as I did, when I switched from the Short feed to the longer Jump-Break feed--that your blog-journey is cut short.

Apparently, there is a limit to the size of feeds that feed2js.org will run. So chopping your feed into time periods lets you get around that problem, if you want your blog journey to be complete.

There's a bit more about that issue in this post, which I will revise as I learn more.

In the mean time, note that my Full-and-Jump-Break pipe now has start and end date fields.

Feeding your content through the pipe

Update: This report is obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

Assuming you want to implement my blog-journey hack badly enough to have set up a feed and read an introduction to Yahoo Pipes: don't turn back now.

Here is the quick-and-dirty.

Slicing and Dicing with Yahoo Pipes

Update: This report is obsolete. Online stuff changes from time to time, and for this topic a revision would be impractical.

Read more about archived posts, if you like.

Perhaps the strangest part of my blog-journey hack entails sending your blog feed through Yahoo Pipes.

Pipes is a free web-based service for mixing and manipulating feeds. Working on the (imperfect) metaphor of your feed as a flow of content, users construct a "pipe" that channels and changes the elements of that flow--for instance, sorting them chronologically.

Feed types: Short versus Full versus Jump-Break (versus just titles)

A feed broadcasts your blog posts to subscribers, either the entire blog post (if you set up Full feed) or the first 250 characters or so (if you set up Short feed).

My blog-journey hack is based on using a feed of your blog, so if you want to show your content in chronological order, you have to chose one of those two options.

Full Feed
Pro: Retains hyperlinks and character formatting. Easiest to set up and maintain as blog-journey page.

Con: Sends all of each post to your subscribers.
Short Feed
Pro: Makes short “teaser” lead-ins to your actual posts. Less scrolling on your blog-journey page.

Con: Blog-journey page more work to set up & maintain. Some formatting is lost.
Jump-Break Feed
Pro: User sets cut-off point for each post. Preserves all formatting and blog-journey is as easy as for the Full feed.

Con: Compared to Short feed, can make a longer and bigger Blog Journey page; break (if any) must be set for each post.

Set your choice on Blogger, at Settings > Site Feed > Allow Blog Feeds.

Getting your feed

My blog-journey hack is based on manipulating and formatting a blog feed.

There's a lot you could know about feeds, and I'm no expert. Here's a primer and some resources sufficient for hack purposes.

A feed takes your blog content and squirts it over the internet to feed subscribers.

The subscribers may view the feed in many different ways that should not concern you. As a blogger, you only need to decide (1) whether to allow feeds of your blog at all and (2) if so, how much of your content to include in the feed.

The settings for your blog feed are at Settings > Site Feed and you can chose from "None," "Short," "Until Jump Break," and "Full." Short will truncate each post in your feed at about the 250th character, which is useful if you write good lede paragraphs. "Until Jump Break" lets you decide where to truncate each feed posts.

If your goal is to reproduce every word of every post in your blog in chronological order, you need to pick "Full." You can change this setting at any time.

There are other advantages and disadvantages to each. More about this choice here.

Blogger has this handy help page about feeds.

Once you've enabled your feed you can view it at its own url as follows. (Substitute your blog name from your blog url for "YOURBLOGNAMEHERE.")

http://YOURBLOGNAMEHERE.blogspot.com/feeds/posts/default?max-results=999

This is the url that you will send through Yahoo Pipes.

Update: If you burn your feed at Feedburner (or elsewhere), read this.

Wednesday, May 19, 2010

First things first: putting your blog in order

A new method for showing blog content in chronological order.

Update: I am sorry to say that this method no longer works because of the demise of Yahoo Pipes, a web service that allowed bloggers to sort their blog feed.

It was, briefly, the state of the art, in a mad-scientist sort of way.

There are still several other valid, if unintuitive, ways to show blog content in chronological order.

This hack was my first venture into messing around with Blogger's plumbing. It was Rube Goldberg, it was spit-and-chickenwire; it was in every way too clever by half, and now it has suffered the final fate of all things clever in that way. 

I will indulge my sentimentality by not deleting the many posts I sweated over back in 2010, but they are useless to you. If you want to reorder your blog posts, check out one of the remaining methods