I’ve continued enhancing the Stanza catalog I created earlier. New features include purchase links and Google Analytics tracking. I reverse-engineered the FeedBooks API and the AllRomanceBooks.com feeds to figure out how to do some of these things. Also I’ve been reading the OPDS spec (an industry-standard successor to the Stanza format) to add support for e-readers on other platforms. For example Aldiko officially supports OPDS, but it recognizes Stanza tags as well. It crashes if you try to open a PDF file however – so it just needs to be sent the right mime type.
Here’s the snippet where I reference the custom Analytics class I added:
p.StoreDescription += Mises.Domain.Mobile.Analytics.GetAnalyticsImageTag(this.request.RequestContext.HttpContext); var content = new TextSyndicationContent(p.StoreDescription, TextSyndicationContentKind.Html); item.Content = content; |
And here’s how to add external links to a book info view:
item.Links.Add( new SyndicationLink( new Uri(string.Format("http://mises.org/store/Product.aspx?ProductId={0}&utm_source=MisesCatalog", p.ProductId)), "alternate", "Purchase at the Mises Store", "text/html", 0)); |