# RDF/ATOM style for LiveJournal written in S2
#
# Copyright (C) 2005 Nikolas Coukouma
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# This style is written in S2 and is intended to be used with LiveJournal or
# LJ-derived sites. It must, at the very least, support the core layer. It
# renders any view as an ATOM feed. The ATOM core is augmented with a variety
# of schemas to supply more info (like moods and comments).
# It uses the following namespaces:
#
# * atom - http://atomenabled.org/developers/api/atom-api-spec.php
# * rdf - http://www.w3.org/1999/02/22-rdf-syntax-ns#
# * rss - http://web.resource.org/rss/lj/1.0/
# * lj - http://www.livejournal.org/rss/1.0/
# * slash(dot/code) - http://web.resource.org/rss/1.0/modules/slash/
# * blogcomments - http://philringnalda.com/ns/blogcomments/
#
# The following information is included:
#
# * Per page (atom:feed):
# o atom:title - title of the journal
# o atom:tagline - "subtitle" of the journal
# o atom:link - rel=alternate, href=url of the journal
# o atom:generator - string stating that LiveJournal and this style were used to generate this feed
# o rss:image - the default userpic of the journal being viewed (not included for the friends page)
# + rss:url - location of the userpic
# + rss:title - title of journal
# + rss:link - url of journal
# + rss:width - width of the image, in pixels
# + rss:width - height of the image, in pixels
# * Per entry (atom:entry):
# o atom:title - entry title, stripped of HTML
# o atom:id - href=permalink to this entry
# o atom:link - rel=alternate href=permalink to this entry
# o atom:link - rel=prev href=previous entry
# o atom:link - rel=next href=next entry
# o atom:author - the author of the entry
# o atom:content - type=text/html, mode=escaped, contains the post itself
# o atom:issued - when this entry was first posted
# o atom:modified - when it was modified. currently bogus and the same as issued
# o lj:mood - mood string
# o lj:music - music string
# o slash:comments - number of comments
# o blogcomments:comments - comments to this entry
# * Per comment (blogcomments:comment):
# o atom:title - comment title (subject), stripped of HTML
# o blogcomments:name - username of the poster
# o blogcomments:url - permalink to the comment
# o blogcomments:date - when the comment was posted
# o blogcomments:body - the actual text of the comment
# o blogcomments:comments - any repplies to this comment
#
#
# To use it on LiveJournal:
#
# 1. You must have a paid account
# 2. (This and the next two steps are optional if you're using LiveJournal)
# Go to your layers and create a new top-level layer of type layout
# 3. Click on edit
# 4. Replace the default stuff with the source.
# 5. Go to your styles
# 6. Create a new style. The name and language don't matter.
# 7. Select the layer you just created from the Layout dropdown and click Change.
# OR, if you didn't create your own layer (skipped the last three steps)
# select Other ... and enter the layer id 3770393.
# 8. Ignore the Language, Theme, and User dropdowns. Just click Save Changes
# 9. You can now view any journal page in this style by appending s2id=xxxxxxx
# to the query string (replace the x's with the number of the style you just created).
# For example:
# http://www.livejournal.com/users/atrustheotaku/?s2id=5922201
# or
# http://www.livejournal.com/users/atrustheotaku/?auth=digest&s2id=5922201
#
# If you find a bug or would like to make a suggestion, please e-mail me.
#
# This style is licensed under the LGPL.
# http://www.gnu.org/copyleft/lesser.html
#
# Created with the help of LiveJournal editing tools.
# http://www.livejournal.com/customize/advanced/
layerinfo type="layout";
layerinfo name="RDF (ATOM)";
layerinfo des="Displays an RDF feed of the requested view";
layerinfo author_name="Nikolas 'Atrus' Coukouma";
layerinfo author_email="atrus@REMOVEME atrus.org";
layerinfo source_viewable=1;
layerinfo is_public=1;
#inherited properties
property use page_recent_items;
property use page_friends_items;
property use IMGDIR;
# number of items to show on the page
set page_recent_items = 10;
set page_friends_items = 10;
# order in which to render entries and comments
property bool first_to_last;
set first_to_last = true;
# conform to W3C spec, as referenced by ATOM spec
# http://www.w3.org/TR/NOTE-datetime
property string dateformat;
set dateformat = "%%yyyy%%-%%mon%%-%%d%%T%%hh%%:%%min%%:%%sec%%+00:00";
function Page::print() {
# argh! still not commited
# set_content_type( "text/xml" );
var string strTitle;
$strTitle = $this->title();
"""