MacDevCenter    
 Published on MacDevCenter (http://www.macdevcenter.com/)
 See this if you're having trouble printing code examples


Everything You Wanted to Know About Safari RSS, Part 2

by FJ de Kermadec
06/03/2005
What are Syndication Feeds

Editor's note: In part one of this series, F.J. provided a solid overview of the Safari browser and the RSS specification. In this article, he focuses on viewing and customizing your news feeds in Safari RSS.

Viewing Options: An Introduction

Now it's time to examine the actual interface for viewing your RSS news.

Article Length

The "Article length" slider is a nice feature, allowing you to see more content on the page. As many sites only provide excerpts of their content on an RSS feed, though, its usefulness can at times be questioned and will depend on whether the feeds you check can actually be shortened without losing all meaning.

Sort By

Sort By is the first option you'll want to explore. It's in the right nav bar, as shown below. Indeed, what would be the point of collecting information if you didn't know where on the page that information is? In a single feed, sorting articles by title, source, or date each have their advantages. Sorting by title is a great way to find something in a directory's feed.

The first place to look for organizing your feeds is the Sort By option in the right nav bar.
The first place to look for organizing your feeds is the Sort By option in the right nav bar.

Sorting by Date and New have more or less the same effect in a single-feed context, as one would expect you to read posts as they arrive. That ceases to be true in a multi-feed context, though, and I lost many posts at first for failing to realize that. Conflicts between the time at which posts are written, feeds are posted, and then downloaded by Safari can sometimes cause unread feeds to fall at the bottom of the list--because, technically speaking, they are "old." Additionally, some feeds improperly tag their posts or don't honor time zones, and you can rapidly end up with a fine mess.

Sorting by Source can be very useful if you pull a custom feed from a web-based aggregator and wish to better separate out its contents. There does not (yet) appear to be a way to sort by author or contributor within a feed, but hopefully we'll see that soon.

The side bar, even though it does not feature any real "buttons" actually acts on the feed display and, therefore, in pure interface logic, could probably follow the Aqua guidelines to better signify its belonging to the "application" side of things. For now, though, clicking on the words that behave like web links, complete with underlining and coloring, will do the trick. Keep in mind that the result may not be instantaneous, as Safari may need to do a bit of work to reorder all of the feeds and display them. In my testing, it's occasionally necessary to click a couple of times on a link to make the change happen.

A nice feature, though, is the ability to only display the titles of feeds, which can be useful on some sites that provide descriptive headlines--or for those "I just keep them in my bookmarks to say that I read them" sites, which I won't name, but I am sure you know.

The feed pages behave like regular web pages, meaning that pressing the space bar to jump to the "next screen" (to speak in very DOS terms) will work, much like the Apple-arrow key combinations to jump to the top or the bottom of the page.

A Few Keyboard Commands

Thanks to the improved text handling in WebKit, triple-clicking on a paragraph now selects it whole, making copying and pasting content a lot easier than it is with many RSS readers. Apple-clicking on titles and links will allow you to open full articles in new pages, while you keep on reading your RSS summary, without the need to open an extra application or switch between windows. Of course, this implies that Safari is not set up to automatically switch to new tabs as soon as they are open or you are in for both retina problems and carpal tunnel issues.

This, for now, should give you a good start around the page. In my experience, Safari is great at loading even complex feeds and rarely chokes on them. When it does, though, expect to pause for a few seconds before resuming your work, as it tends to freeze the application as a whole--but that's uncommon and far from an annoyance.

The RSS URLs

If you look at the address bar while Safari displays an RSS window, you may notice that our http:// URL, the one commonly accepted by news readers everywhere, has changed to a feed:// one, along with a cool scrolling effect--which, in typical Apple fashion, is also available in slow motion if you hold down the Shift key while clicking on the RSS button. What does this mean?

Well, the feed:// URL is a way to tell your Mac "This is a feed. Now, go grab the application that handles feed on that machine and open it quickly." If Safari is your default RSS reader--you can specify that in the preferences, as we are going to see in a few seconds--then opening a feed:// URL will cause it to launch, switch to the appropriate view, and display the feeds. If it is another application, it will cause that application to do the same. You could pick Chess or iTunes as your default RSS reader, but that wouldn't bring much, except a good laugh or a horrendous crash.

The RSS url
The RSS URL

The feed:// URLs, even though they aren't what one would yet call a widely accepted standard, have one advantage: they will allow you to specify different applications as your news reader and use them at the click of a button--much like a dict:/// URL will launch Dictionary.

When fed a feed (got it?), Safari will automatically understand that you expect it to enter the RSS view and will change the URL for you. Should you decide to bookmark the feed--there is a handy link in the right-hand column for that--save it as a web shortcut on your Desktop or put it in your Dock, your Mac will automatically recognize it and will pick the appropriate application and view to open it at a later date.

The downside of feed URLs is that they make importing any feeds you might already have bookmarked in Safari more difficult. Indeed, having Safari do the conversion every time not only is a bit silly and will slow you down but, in a context where you open multiple feeds at once, leaving http:// URLs in the middle has a potential to confuse our beloved browser and open, side by side, feeds and pages--which is more of a fun bug than a really problematic one, but it does feel a bit messy nevertheless.

Real RSS feeds and Atom feeds are also given the same URL, which might confuse some applications. For example, your news reader of choice may not include Atom support, but it would still be passed Atom feeds by the system because of the URL choice. There are workarounds--as the two feeds are definitely different--but that might raise an issue for older applications that aren't aware of that new feature.

Setting Up the RSS Preference Pane

Now that you have a feel of what an RSS feed is and how it behaves on your system, it's time to to tell Syndication Agent to do what you want. In true Apple fashion, this can be done directly through the Safari preferences, in the (drumroll) RSS preferences pane.

You choose your RSS reader here in the Safari preferences pane.
You choose your RSS reader here in the Safari preferences pane.

As mentioned, your default RSS reader can be whatever application you like. If you decide to use Safari as an RSS reader, you're probably going to keep your bookmarked feeds in your Bookmarks bar, right where you can see them. That way, you'll immediately be notified of updates.

Keep in mind that the more feeds you have, the more your Mac will have to go onto the network and download information. If you wish to have a feed "cold storage" area where you put interesting links that are not part of your daily checking routine, you might want to keep them in the Bookmarks menu and disable the automatic updates there. For this very reason, I tend to delete the Apple-provided feeds first thing when I launch a fresh copy of Safari. This is not because they are bad--some of them are actually excellent--but keeping so many feeds and setting them to auto-update in addition to yours is probably going to be more than both your connection and your neurons can handle.

Keeping your RSS feeds on the Bookmarks bar is an easy way to monitor new items.
Keeping your RSS feeds on the Bookmarks bar is an easy way to monitor new items.

Automatically Check for Updates

Updating time is a very touchy topic. While some users (me included) would like to update our feeds as often as possible so that we can calmly read one or two posts at a time instead of the dozen that seems to restlessly crop up every half hour, we have to think of the poor webmasters who need to pay bandwidth costs every time Syndication Agent queries their server.

In this aspect, Safari lacks granularity, and the impossibility to set different refresh times on a per-feed basis--at least through the interface--has made many webmasters unhappy. For now, the best compromise between speed and kindness of heart seems to be the "30 minutes" setting.

An alternative is to set Safari up so that it does not automatically check for updates and to refresh the list manually. Even though this is a lot less interactive, it's nice to know the option exists. And it's useful for those times when you are stuck on a dial-up or UMTS link.

The Remove Articles Option

The "Remove articles" feature in the Preference pane allows you to choose how long you retain the news you've downloaded. Sure, the size of the feed database will grow, but this can be a very quick and easy way to build up your very own personal library. Of course, this option will be of most use to users with roomy hard drives. This database, in SQLLite format, lives snugly and happily in your Library/Syndication folder--it might be a file to back up if you rely on your saved feeds for work.

Deleting this library will cause Safari to re-download all of your feeds, which can be a slow and tedious process--not to mention that it will completely delete any records of what you have read and haven't, which can cause serious organizational problems. On the other hand, deleting the database can help clear feed-related issues and sluggishness if, for example, Safari saved an unusually large or corrupted file that was distributed by a feed.

Color New Articles

The ability to color new articles is a must, and it's even surprising that it's presented as an option--but, hey, it cannot hurt, can it? While my profound dislike for orange and blue combos would push me to suggest you pick a more creative shade, the choice is ultimately yours. Even better, the whole palette of Apple's colors is at your disposal so you can get creative. The important thing is that the color can be spotted easily in a long list of feeds.

A Note About News and Updates

Before switching full-time to Safari RSS, I would like to point out that RSS readers are sometimes strange beasts. They all rely on some kind of parser, no matter how evolved, to make sense out of the great many flavors of RSS that are out there. Therefore, it can happen that the same feed will be handled differently by two different news readers.

Running Safari RSS along with another RSS reader on my test machines for a few days led to some very unexpected results. Both applications saw posts that the other didn't, showing that, despite the many, many means we now have at our disposal to obtain information, the battle isn't won yet--far from it. Whether these idiosyncrasies are due to bugs in the readers or malformed feeds (and, actually, where does one end and the other start?), we will probably never know but you might want, should you rely on the content of a truly mission-critical site, to also subscribe to a mailing list or, at the very least, refresh a "news page" they may have from time to time to be sure you do not miss anything.

Finding Feeds to Add

One of the most advertised features of Safari is its ability to auto-detect feeds and put them right in front of you, in the form of a big blue RSS button in the address bar. That is one very nice feature, indeed, and it will greatly simplify the task of users who wish to quickly build an RSS feed collection. Unfortunately, it is not the best working of features either as the wording of the help files shows: "Many websites have more than one RSS feed. For example, a newspaper's website may have separate feeds for news, sports, and entertainment articles. The RSS button in the address bar displays just one of those feeds. To find the others, search the website for links to them."

That is all very well, but which one will appear? For example, what should we think of this Apple page that contains no fewer than 27 feeds and, yet, at time of writing, does not bring up the RSS badge?

The RSS badge at the end of the URL
The RSS badge at the end of the URL

As long as a site specified the RSS feed as an Alternate link to the page--which is done within the head tags of the code--and that this feed is working, and you should not have any problem finding and using it. In other words, Safari expects sites to support the standard feed auto-discovery procedure and that is a fair assumption from a technological point of view. Parsing HTML markup is slow and unreliable, so one might as well try to use solutions that exist.

Unfortunately, many sites will not go that route, and will simply add a link somewhere in the page for you to see and click on. So far, Safari will ignore these. Of course, things may change in the future and, as coding styles vary greatly, Safari may find its way more easily around some sites, but you should keep in mind that not seeing the blue RSS badge does not mean that there is no RSS feed to be found. While you are at it, you might want to send a friendly mail to the webmaster of the site, encouraging him to set up auto-discovery on the pages: spreading the word can only help sites improve. Of course, there is nothing really wrong with not using that feature in a site's code so don't take it personally if your suggestion is not implemented.

Usually, you can quickly ascertain whether a site contains in fact an RSS feed by searching for the following words on the page: "Syndicate," "XML," "RSS," "RDF," "Atom," or "Feed." The Find command (Apple-F), as usual, will do that for you quickly. The truly passionate among us will perform that search on the page's raw source to ensure that they do not miss a link that would be an image but, at that rate, one might just want to scan the page visually.

The Apple-provided RSS feeds are usually a great resource to scan first if you are new to the RSS world. But, as we discussed, you probably won't want to keep them all.

Using Safari as an RSS Reader

The first use that comes to mind when the RSS capabilities of Safari are mentioned is using the application as an RSS reader, instead of relying on a dedicated program. That actually does have advantages, the first being that it reduces the number of applications you will need to install on a new system to be fully set, and will also make for a much smoother checking routine. Also, Safari's ability to display all the feeds in one, nicely formatted "super page" may, for some, have a great appeal.

While Safari may not at first seem ideally suited to be used as an RSS reader, we will soon see it is actually relatively easy to "build" that feature.

How Safari Notifies You of New Stories

The first quality of an RSS reader is that it notifies you in a timely fashion of RSS arrivals, usually through a badge displayed on its Dock icon--unobtrusive and visible at the same time. The best way to emulate that in Safari is to place any feeds you wish to update in a bookmarks folder that you will keep in the Bookmarks bar.

That way, Safari will display a number in parenthesis next to its name indicating the number of new entries in your feeds, as the syndication agent discovers and downloads them. No other forms of notification (such as system sounds or menu items) can be implemented by using Safari's built-in features but, given the time we spend on the web daily, the Bookmarks bar is probably something you are going to see. Unfortunately, Safari has no way to alter its Dock icon to let you know that there are unread feeds, either, meaning that you need to keep a Safari window open if you do not do so usually. But that is about the only regret I might have.

Safari shows you in parenthesis how many new stories have arrived.
Safari shows you in parentheses how many new stories have arrived.

The easiest way to create this folder is to use the Bookmarks menu and to select "Show all bookmarks," which will take you to the traditional Safari bookmarks management interface--which has luckily been greatly enhanced compared to the previous versions and is now responsive again, even with large folders. In the Collections column, be sure to pick "Bookmarks bar" and use the little "+" button located right underneath the Bookmark column to add a folder. You might want to give it a nice name such as "Feeds" (if, like me, you suffer from an utter lack of imagination) to distinguish it from your normal folders. You should immediately see that folder appear in your Bookmarks bar above.

Adding New Feeds

Now is the time to start populating your feeds, either by browsing the Web, displaying feeds, and clicking on the handy "Add to bookmarks" link, or by dragging existing URLs from other bookmark collections. For the reasons mentioned above, you will want to ensure that your feeds are all entered in the feed:// form and not http:// which, should you import feeds from another application, might require a bit of work at first, but will definitely be worth it in the end. Notice that Safari will display a cute little RSS badge in your bookmarks list as soon as it recognizes that it is dealing with a feed that will be periodically updated if you so wish.

The new bookmarks search feature can be a lifesaver, should you ever need to ensure that you do not add duplicates or triplicates to an existing large library of feeds. It can also allow you to quickly find the address of a specific feed, even though I find the auto-complete feature of the address bar works just as well. Safari will include these feeds in the auto-complete list, which can be really neat (if you want to grab the address quickly) or a big pain (if you are interested in the web version of the page).

Feel free to create as many subfolders as you like in this folder. This can be done by selecting this Feed folder and clicking the "+" button ad nauseam, until all the categories you are accustomed to have been recreated. Actually, feel obliged to create categories! Indeed, this will allow for a much smoother workflow management system and, in these times where you need to focus on your core activities, will allow you to only read essential feeds and keep the fun ones for later.

In my case, for example, I like to have a Mac news folder that I check 'round the clock no matter what and a "Cosmetics" one that keeps me updated on the latest powders, foundations, and moisturizers (which is sometimes a lot more fun than security holes in RealPlayer but, in the end, a lot less essential to the well-being of my network).

You do not need to worry about these subfolders interfering with the visual indicator we just created in the Bookmarks bar. Safari, being the math wizard we know, will dutifully perform any math required to keep you posted on the overall status of your feeds. Should you need to keep one feed across folders or categories, you can duplicate it (Option-drag) but Safari will not display it twice in the bookmarks bar; a very nice feature!

Once your collection has grown, chances are that Safari will display hundreds or thousands of "unread" feeds. That is nice but definitely overwhelming, so we need to find a way to quickly read these feeds all at once when we need them, while still being able to see, folder by folder, what is new. Don't you think?

The first step towards this is to set your folder containing all the bookmarks to "Auto-click," in Apple's words. When it comes to web pages, "Auto-clickable" folders will open one page per tab, as you might expect. They were actually my method of choice to scan my list of important sites before I really got into the RSS movement and can still be useful, although less practical. When it comes to RSS feeds, however, Safari will be smart enough to "aggregate" all of the feeds in one large meta-page so that you can have a look at them all. This one single feature makes Safari the perfect Aggregator in that you can see hundreds of feeds on one single, smooth, white page.

There are, however, a couple of warnings to keep in mind about these folders. The first is that they have the very bad habit of replacing all of the tabs you have open in a window when you click on them. If that ever happens to you, simply breathe and click on Back before you touch anything else and your tabs should be restored--remember, RSS behaves almost like a separate mode inside of the browser. The second is that, once clicked, even by mistake, the number of "new" feeds displayed in the bookmarks bar will disappear, meaning that you might just as well go ahead and read the headlines before forgetting about them and missing them.

What Are Syndication Feeds

Essential Reading

What Are Syndication Feeds
By Shelley Powers

Syndication feeds have become a standard tool on the Web. But when you enter the world of syndicated content, you're often faced with the question of what is the "proper" way to do syndication. This edoc, which covers Atom and the two flavors of RSS--2.0 and 1.0--succinctly explains what a syndication feed is, then gets down to the nitty-gritty of what makes up a feed, how you can find and subscribe to them, and which feed will work best for you.


Read Online--Safari
Search this book on Safari:
 

Code Fragments only

If you have feeds across multiple folders, viewing them at once should cause them to be considered as "viewed" in the other folders as well, even though the Bookmarks bar may not immediately refresh to show that change--a cosmetic bug more than anything else, but one worth correcting.

In order to get a detailed view of what has been refreshed within your feed collection, you can Option-click or Apple-click on such a folder to see its structure, like any normal, non-auto-click one. This gives you lots of ways to organize your feeds and open them selectively by drilling down to some specific subfolders and selecting "View all RSS articles" or hand-picking your feeds, or even clicking on the button to see it all in one go. As you can see, what might have seemed at first to be a simple "all or nothing" button actually hides a lot of flexibility as soon as one starts poking around.

New Feeds at the Top

Now, having all of your feeds nicely puréed on a single page unfortunately does not a reader make. It is essential that you have them properly set up to benefit from it. The first thing, obviously, is to set up your feeds so that the "New" ones are displayed at the top. You will also want to display "All" articles, as the "Today" setting can play very nasty tricks on you around midnight--and it's always midnight somewhere around the globe, so you might end up missing a lot of information.

A handy list of feeds on the right allows you to single out a specific feed should you want to. Even if your feeds are nested in folders, Safari will flatten that up and display them all on the right, in the order in which they appear, which may seem a bit confusing at first--which is why it is important to order your feeds carefully. As we discussed earlier, the "Mail link to this page" button, although tempting, will be of little use as it will mail a gigantic, strange looking URL to the recipient who won't be able to make use of it unless he has a Mac running Safari RSS as well--or a computer capable of understanding these URLs.

Unread posts will appear in color (the color you specified in the Safari preferences), even though, in an interesting twist and in a stroke of genius, Safari does not highlight the title of the post but the name of the author instead. After all, it sits right next to the title, so you can't miss it, but it allows you to go crazy with the colors without ruining the contrast of the titles and making them hard to read. Clicking on the title or the author's name should bring you to the page of the site to which the post corresponds, much like in any other RSS reader. Be sure to enable tabbed browsing and hold that Apple key down to open the page in another tab and keep scanning headlines!

As soon as you click on the title, the coloring disappears. However, should you reload the feeds page, you will notice that any colored articles will now be displayed as read--Safari interprets your reloading the page without reading the articles as a sign that they don't interest you, which seems a fair assumption to make. Other news readers will insist that you click on an article to remove it from the "new" list which will ensure that you do not miss a drop of news, but can also be very unnerving. While it is up to you to decide which behavior you prefer in the long run, I have found the Safari point of view to be well thought through, even if it required a few days of playing around to feel fully comfortable.

While the search feature located on the right-hand side is very useful, in light "News Reader" use, I find the Safari "Find" window (Good old Apple-F followed by Apple-G) to be a lot faster and, therefore, more agreeable to use. Of course, should your collection of the day span across multiple pages, you will need to use the heavier, more powerful Search box, but that is a nice alternative.

Safari does not like being forced and will not display new feeds (or not all of them) until the time for it to refresh has struck. Therefore, reloading the feeds page is not going to do any good, and you will need to wait until a fresh batch of entries arrive to get a chance to see the latest news. While that might seem strange (and even infuriating) to those of us who are used to having a "Refresh all" button, it actually helps better pace your work, once you are used to it. Loading the feeds page while the Syndication Agent is bringing posts in is not going to do much good, and you might end up with half your feeds open and others still to be seen. While that is by no means an issue, it is good to allow a few minutes for all of the new entries to download before you decide to proceed with reading.

Final Thoughts

Most people remark that it takes them a day or so to get their RSS workflow set up in Safari. But I've heard positive comments once they get everything in order.

In the final installment of this series, I'll cover using Safari RSS as an aggregator, plus look at some nifty automation tricks. See you then!

FJ de Kermadec is an author, stylist and entrepreneur in Paris, France.


Return to MacDevCenter.com.

Copyright © 2009 O'Reilly Media, Inc.