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


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
# SS-RSS_rotate.pl
# release version 2.0
# May 17, 2005
# rick@aveight.com
# 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 =	(	
'www.macosxhints.com/backend/geeklog.rdf', 
'newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml', 
'slashdot.org/index.rss', 
'www.theregister.co.uk/excerpts.rss',
'www.macworld.com/rss.xml', 
'www.versiontracker.com/macosx/recent.rss',
'www.nytimes.com/services/xml/rss/nyt/HomePage.xml',
'news.com.com/2547-1_3-0-5.xml',
'www.washingtonpost.com/wp-srv/print/a1/rssheadlines.xml',
'www.apple.com/main/rss/hotnews/hotnews.rss',
'www.iht.com/rss/america.xml',
'wired.com/news/feeds/rss2/0,2610,3,00.xml'
	);
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]);
exit();

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

[ Reply to This | # ]