Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: See multiple feeds over time in RSS screen saver System 10.4
Tiger only hintI wrote a Perl script to rotate the RSS screen saver feeds every hour, using the plist hack hint as a basis. Currently, there are six feeds, and the script works best when the total number of RSS feeds divides 24 hours nicely. This insures that each feed gets an equal shot in the rotations each day.

An interesting note -- if the RSS screen saver plist file is modified while the screensaver is running, the display won't change to the next feed until the screensaver is reloaded (deactivated, then reactivated).

I set up a cron job to run the script every hour, and it keys off the number of RSS feeds and the hour value to determine which feed to display next. Forget the need to have a different screensaver for each URL!

[robg adds: I haven't tested this one...]
  • Currently 2.00 / 5
  You rated: 1 / 5 (4 votes cast)

10.4: See multiple feeds over time in RSS screen saver | 2 comments | Create New Account
Click here to return to the '10.4: See multiple feeds over time in RSS screen saver' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: See multiple feeds over time in RSS screen saver
Authored by: fungus on May 31, '05 01:55:43PM
I like the idea of your script, but the actual implementation is ugly. Most of the hints lately have been doing awful things with plist files. You almost never need to convert a binary plist to an xml file. Also many, if not all, applications don't care if the plist is xml or binary.
  • If you want to edit a binary plist by hand use the "Property List Editor" built-in appliction.
  • If you want to read/modify a binary plist from a shell,perl,python,etc script, use the defaults command. See man defaults
A better example of the actual plist change for this script would be to replace almost all of the change_RSS_feed function to this command.
`defaults write $plist_file feedURL $new_feed`

[ Reply to This | # ]
10.4: See multiple feeds over time in RSS screen saver
Authored by: t7p0m8st3r on Jun 01, '05 06:22:13AM
I whole-heartedly agree. My implementation in the original script was lousy. Thanks to other .plist hints, I did discover that my code was not an efficient way to go. I re-wrote the script and sent it in, but I guess it got separated from the original hint. This version starts with a different feed in the list each day, to get a little extra rotation into the mix. Here it is, if you're interested:
#! /usr/bin/perl -w
# release version 2.0
# May 17, 2005
# Rick Smith
# VERSION HISTORY: removed to be concise
# rotates RSS Screensaver by hour, and starts with different RSS each day.
# rotation may jump unpredictably on first day of each new year.
my @RSS_sites =	(	
my ($Second, $Minute, $Hour, $Day, $Month, $Year, $WeekDay, $DayOfYear, $IsDST) = localtime(time);
my $sequence_value = $DayOfYear + $Year + $Hour;
my $num_urls = @RSS_sites;
my $max_index_val = $num_urls - 1;
while ($sequence_value > $max_index_val)
	{	$sequence_value = $sequence_value - $num_urls;		}
system("defaults", "-currentHost", "write", "RSS Visualizer", "feedURL", 'http://'.$RSS_sites[$sequence_value]);

My guitar wants to kill your mama.
-- Frank Zappa

[ Reply to This | # ]