The New York Times: Stanza: “The iPhone or iPod Touch can act as an electronic book reader.”
Tip of the Week: Turn Your iPhone Into an e-Book

Online Catalog help

I'm trying to code some PHP scripts to automatically generate Stanza-compatible online catalogs of fanfiction sites (actually, just Fanfiction.Net). So far, I think I've got the basic functionally down. I'm just trying to add some more "functions" to the catalog such as an "Add to Favorites" link. One of the problems I encountered is when I click on the link, it opens Safari instead of using the embedded browser. While I think that's fine for complex websites, I don't see why it should do the same for something that just tells you "blah, blah, blah has been added to your favorites". How do I make it so the page opens in the embedded browser instead of exiting Stanza and opening the page in Safari? Are there any special HTTP Headers I need to specify? BooksOnBoard seems to work well inside the embedded browser and for the life of me, I really have no idea what I'm doing differently.

For reference, here's what a sample atom feed entry looks like:

<entry>
<title>Love, Lies and Empire</title>
<id>urn:ffnet:3094819-Love_Lies_and_Empire</id>
<author><name>krystalMage</name></author>
<updated>2009-04-28T00:00:00-07:00</updated>
<link type='application/epub+zip' href='/ffnet/epub/3094819' />
<link rel='authorpage' type='application/atom+xml' title='Other stories from this author' href='/ffnet/auth/1108508' />
<link rel='fs' type='text/html' title='Add to Favorites' href='/ffnet/fav/3094819' />
<link rel='x-stanza-cover-image' type='image/png' href='/ffnet/cover/3094819' />
<link rel='x-stanza-cover-image-thumbnail' type='image/png' href='/ffnet/thumb/3094819' />
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml' style='text-align: left'><b>Story ID:</b> 3094819<br /><b>Category:</b> Rurouni Kenshin<br /><b>Genre:</b> Drama / Romance<br /><b>Pairing:</b> Kenshin &amp; Kaoru<br /><b>Chapters:</b> 14<br /><b>Words:</b> 100,221<br /><b>Published:</b> 8-9-06<br /><b>Updated:</b> 4-28-09<br /><b>Status:</b> In-Progress<br /><b>Summary:</b> Chapter 14 UP! AU Falling in love with the enemy was the last thing Kenshin wanted to do. Especially an enemy who seems hell bent on killing him. "I free you of any obligation you feel to protect me".BKK. Read and Review.</div>
</content>
</entry>

And here's a sample Add to Favorites page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Love, Lies and Empire</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=200; initial-scale=1.0; maximum-scale=2.0; user-scalable=1;" />
<meta name="stanza-toolbars" content="hide" />
<link href="/ffnet/mobiletext.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="title">Love, Lies and Empire</div>
<div id="description">
<hr/>
<p><b>Love, Lies and Empire</b> has been added to your favorites.</p>
</div>
</body>

</html>

Thank you for all the help and more power!

support's picture

If you prefix the link with

If you prefix the link with "stanza:" instead of "http:", it will open in Stanza's embedded browser rather than launching Safari.

Thanks. I guess that means no

Thanks. I guess that means no relative links, then? Hmm... will have to figure out how to automate this in PHP so it will work both locally and online.

support's picture

That is indeed a problem with

That is indeed a problem with relative links. We hope to have a better solution for this in the future.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.