Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Photocasting



On 1/12/06, Phil Ringnalda <email@hidden> wrote:
> Two URLs: you apparently send
> http://photocast.mac.com/mrakes/iPhoto/photocast_test/index.rss as a
> test: if your friends are using an Apple-approved reader then that URL
> works directly, but if not, and they open it in an unapproved browser,
> then it tests a second thing, whether or not they will read an entire
> error message closely enough to spot the fact that it includes a
> different URL, http://web.mac.com/mrakes/iPhoto/photocast_test/index.rss
> which doesn't care about your user-agent string.
>
> I'd be interested in knowing whether the feed returned by
> photocast.mac.com is the same as the one returned by web.mac.com, but
> not interested enough to, you know, actually tell wget to use a Safari
> UA string.

$ wget --user-agent="Mozilla/5.0 (Macintosh;U; PPC Mac OS X; en)
AppleWebKit/412 (KHTML, like Gecko) Safari/416.13"
http://photocast.mac.com/mrakes/iPhoto/photocast_test/index.rss

$ cat index.rss
(output hacked to replace <> with [])

[!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"]
[HTML]
	[HEAD]
		[META NAME="generator" CONTENT="WebObjects 5.2"]
[script language="JavaScript"]
[!--
function redirectTo(scheme, host, uri) {
	window.location = scheme + "://" + host + uri;
}
var iPhotoVersionMin = 600;
var iPhotoMimeTypePlugin = "application/photo";	
var host = "web.mac.com";
var path = "/mrakes/iPhoto/photocast_test/index.rss";
var pluginInstalled = false;

var uA = navigator.userAgent;
var safariPos=uA.indexOf('Safari');
var safariVersion=parseFloat(uA.substr(safariPos+7));
var timeout = 250;

var shouldClose=0;
if (safariVersion > 120 && window.history.length < 2) {
    shouldClose=1;
}

if (navigator.mimeTypes && navigator.mimeTypes.length > 0) {
	var iPhoto = navigator.mimeTypes[iPhotoMimeTypePlugin];
	if (iPhoto) {
		var description = iPhoto.description;
		// Split the description
		try {
			var components = description.split(" ");
			if (components && components.length > 1) {
				var pluginVersion = components[1];
				if (pluginVersion >= iPhotoVersionMin) {
					pluginInstalled = true;
					if (shouldClose == 1) {
					    setTimeout('window.close()', timeout);
                    } else {
                        setTimeout('window.history.back()', timeout);
                    }
					redirectTo( "photo", "photocast.mac.com", path);
				}
			}
		} catch (exception) {
		}
	}
}
if (pluginInstalled == false) {
	redirectTo("feed", host, path);
}
--]
[/script]
[/HEAD]
[/HTML]



>From what I can tell, iPhoto 6 registers a MIME type handler of
"application/photo" with the latest version of Safari (included in
10.4.4).  With this handler, Apple redirects to the feed URL.  Without
this handler, Apple redirects to the error page.

No matter.  I've written a Greasemonkey script that completely
replaces the error page with something more useful (inspired by
FeedBurner's friendly subscription pages).

http://diveintomark.org/projects/greasemonkey/friendlyphotocasting.user.js

Screenshot:

http://diveintomark.org/public/2006/01/friendlyphotocasting.jpg

--
Cheers,
-Mark
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
syndication-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/syndication-dev/email@hidden

This email sent to email@hidden

References: 
 >Photocasting (From: James Housley <email@hidden>)
 >Re: Photocasting (From: Mark Pilgrim <email@hidden>)
 >Re: Photocasting (From: James Housley <email@hidden>)
 >Re: Photocasting (From: Mark Pilgrim <email@hidden>)
 >Re: Photocasting (From: Mark Pilgrim <email@hidden>)
 >Re: Photocasting (From: Phil Ringnalda <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.