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


Click here to return to the 'View iPhoto '08 Web Galleries in Safari's RSS reader' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
View iPhoto '08 Web Galleries in Safari's RSS reader
Authored by: mr. applescript on Aug 15, '07 11:01:06AM
Here's an AppleScript script that will get the URL of the front page in Safari, convert it to a feed, and then display the feed in the same page. Save it as a compiled script and put it in the Script Menu.
tell application "Safari"
	activate
	set this_URL to the URL of the front document
	set the feed_URL to my convert_to_feed(this_URL)
	if the feed_URL is not false then
		set the URL of the front document to the feed_URL
	end if
end tell

on convert_to_feed(this_URL)
	if this_URL begins with "http://gallery.mac.com/" then
		set x to the offset of "#" in this_URL
		if x is 0 then
			return false
		else
			-- REPLACE THE # CHARACTER WIH A FORWARD SLASH
			set this_URL to (text 1 thru (x - 1) of this_URL) & "/" & (text from (x + 1) to -1 of this_URL)
		end if
		set x to the offset of "&" in this_URL
		if x is 0 then
			return false
		else
			-- REPLACE THE PARAMETERS WITH NEW PARAMETERS
			set this_URL to (text 1 thru (x - 1) of this_URL) & "?webdav-method=truthget&feedfmt=photocastrss"
		end if
		-- REPLACE HTTP WITH FEED
		set this_URL to "feed" & (text 5 thru -1 of this_URL)
	else
		return false
	end if
end convert_to_feed


[ Reply to This | # ]