RSS
June 01, 2009
XSL for transforming RSS 2.0 to RSS 1.0
<?xml version="1.0"?> <xsl:stylesheet version="1.0" id="rss2to1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/" > <xsl:output method="xml" indent="yes"/> <xsl:template match="/rss"><xsl:apply-templates/></xsl:template> <xsl:template match="channel"> <rdf:RDF> <channel rdf:about="{link}"> <title><xsl:value-of select="title"/></title> <description><xsl:value-of select="description"/></description> <link><xsl:value-of select="link"/></link> <items> <rdf:Seq> <xsl:for-each select="item"><rdf:li rdf:resource="{link}"/></xsl:for-each> </rdf:Seq> </items> </channel> <xsl:for-each select="item"> <item rdf:about="{link}"> <title><xsl:value-of select="title"/></title> <description><xsl:value-of select="description"/></description> <link><xsl:value-of select="link"/></link> <dc:date><xsl:call-template name="FormatDate"><xsl:with-param name="DateTime" select="pubDate"/></xsl:call-template></dc:date> </item> </xsl:for-each> </rdf:RDF> </xsl:template> <xsl:template name="FormatDate"> <xsl:param name="DateTime" /> <!-- new date format 2006-01-14T08:55:22Z --> <xsl:variable name="mo"> <xsl:value-of select="substring($DateTime,9,3)" /> </xsl:variable> <xsl:variable name="day"> <xsl:value-of select="substring($DateTime,6,2)" /> </xsl:variable> <xsl:variable name="year"> <xsl:value-of select="substring($DateTime,13,4)" /> </xsl:variable> <xsl:variable name="time"> <xsl:value-of select="substring($DateTime,18,8)" /> </xsl:variable> <xsl:variable name="hh"> <xsl:value-of select="substring($time,1,2)" /> </xsl:variable> <xsl:variable name="mm"> <xsl:value-of select="substring($time,4,2)" /> </xsl:variable> <xsl:variable name="ss"> <xsl:value-of select="substring($time,7,2)" /> </xsl:variable> <xsl:value-of select="$year"/> <xsl:value-of select="'-'"/> <xsl:choose> <xsl:when test="$mo = 'Jan'">01</xsl:when> <xsl:when test="$mo = 'Feb'">02</xsl:when> <xsl:when test="$mo = 'Mar'">03</xsl:when> <xsl:when test="$mo = 'Apr'">04</xsl:when> <xsl:when test="$mo = 'May'">05</xsl:when> <xsl:when test="$mo = 'Jun'">06</xsl:when> <xsl:when test="$mo = 'Jul'">07</xsl:when> <xsl:when test="$mo = 'Aug'">08</xsl:when> <xsl:when test="$mo = 'Sep'">09</xsl:when> <xsl:when test="$mo = 'Oct'">10</xsl:when> <xsl:when test="$mo = 'Nov'">11</xsl:when> <xsl:when test="$mo = 'Dec'">12</xsl:when> </xsl:choose> <xsl:value-of select="'-'"/> <xsl:if test="(string-length($day) < 2)"> <xsl:value-of select="0"/> </xsl:if> <xsl:value-of select="$day"/> <xsl:value-of select="'T'"/> <xsl:value-of select="$hh"/> <xsl:value-of select="':'"/> <xsl:value-of select="$mm"/> <xsl:value-of select="':'"/> <xsl:value-of select="$ss"/> <xsl:value-of select="'Z'"/> </xsl:template> </xsl:stylesheet>
Posted by pj at 09:02 PM | Comments (0)
RSS 1.0 Job Vacancy Schema
RDF Site Summary 1.0 Modules: Job Vacancies - Version 0.1
Authors
Paul Hollands
URI
http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/
Previous version
http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/
Revision
$Revision: 0.1 $
Last update
$Date: 2005/07/14 21:58:18.295 GMT $
Status
Draft
Rights
Copyright © 2004-2005 Paul Hollands
Available under a Creative Commons License. Some rights reserved by the author.
Description
RSS 1.0 module, for sharing information about UK Higher Education job vacancies.
While this module is primarily designed to allow interoperation and sharing of funding opportunity information among the UK Higher Education Academy it's use further abroad would be most welcome.
Example feed:
An example feed can be found at: http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/jobs_example.rdf
Namespace decalaration
- <xmlns:fundop=http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#/>
RDF Schema definition document
The following RDFS document is embedded in this page: http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule
RSS 1.0 module for job vacancies in UK higher education
RSS 1.0 module, for sharing information about UK Higher job vacancies.
Vacancy Class
The overarching class for job vacancies
This is a sub-class of:
- http://purl.org/rss/1.0/Item
- http://www.w3.org/2000/01/rdf-schema#Resource
Class defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Organization Class
An organization to be used as an object of vacancy with or apply to properties
This is a sub-class of:
- http://www.w3.org/2000/01/rdf-schema#Resource
Class defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
- http://www.w3.org/2001/vcard-rdf/3.0#
- http://xmlns.com/foaf/0.1/Organization
This class is an equivalent of:
- http://xmlns.com/foaf/0.1/Organization
This class is disjoint with:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#Person
Person Class
A person node to be used as an object for the apply to property
This is a sub-class of:
- http://www.w3.org/2000/01/rdf-schema#Resource
Class defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
- http://www.w3.org/2001/vcard-rdf/3.0#
- http://xmlns.com/foaf/0.1/Person
This class is an equivalent of:
- http://xmlns.com/foaf/0.1/Person
This class is disjoint with:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#Organization
ApplicationDeadline Class
Node for the deadline start and end dates for applications
This is a sub-class of:
- http://www.w3.org/2000/01/rdf-schema#Resource
Class defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Range should be some values from:
- http://purl.org/rss/1.0/modules/event/startdate
- http://purl.org/rss/1.0/modules/event/enddate
SalaryRange Class
The salary range for this vacancy.
This is a sub-class of:
- http://www.w3.org/2000/01/rdf-schema#Resource
Class defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Range should be some values from:
- #minimumsalary
- #maximumsalary
minimumsalary property
Minimum value in the salary range.
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#SalaryRange
Range should be one of:
- http://www.w3.org/2001/XMLSchema#integer
- Negotiable
maximumsalary property
Maximum value in the salary range.
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#SalaryRange
Range should be one of:
- http://www.w3.org/2001/XMLSchema#integer
- Negotiable
currency property
The currency which the salary is offered in. Use ISO 4217 currency codes. Default is GBP.
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#SalaryRange
Is in the range of:
- http://www.w3.org/2000/01/rdf-schema#Literal
furtherdetails property
The URI of the web page describing this vacancy
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#Vacancy
Is in the range of:
- http://www.w3.org/2000/01/rdf-schema#Resource
contractduration property
Duration of contract in days.
This is a sub-property of:
- http://www.w3.org/2001/XMLSchema#integer
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#Vacancy
Range should be one of:
- http://www.w3.org/2001/XMLSchema#integer
- Permanent
furtherdetails property
Item property to hold Vacancy reference
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://purl.org/rss/1.0/item
Is in the range of:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#Vacancy
- http://www.w3.org/2000/01/rdf-schema#Resource
salaryrange property
Property pointing to a SalaryRange node
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#Vacancy
Is in the range of:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#SalaryRange
- http://www.w3.org/2000/01/rdf-schema#Resource
applicationdeadline property
Property pointing to an ApplicationDeadline node
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#Vacancy
Is in the range of:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#ApplicationDeadline
- http://www.w3.org/2000/01/rdf-schema#Resource
vacancywith property
Property pointing to an Organization node
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#Vacancy
Is in the range of:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#Organization
- http://www.w3.org/2000/01/rdf-schema#Resource
percentagefte property
The precentage of FTE (Full Time Equivalent)
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#SalaryRange
Is in the range of:
- http://www.w3.org/2000/01/rdf-schema#Literal
Range should be one of:
- http://www.w3.org/2001/XMLSchema#integer
- http://www.w3.org/2001/XMLSchema#float
localreference property
Reference number assigned by advertiser
Property defined by:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#
Property is in the following domains:
- http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#Vacancy
Is in the range of:
- http://www.w3.org/2000/01/rdf-schema#Literal
Example feed:
An example feed can be found at: http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/jobs_example_rdf
<?xml version="1.0"?> <rdf:RDF xml:base="http://minnesota.ncl.ac.uk/fundops_example.owl" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:jobs="http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule#" xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:event="http://purl.org/rss/1.0/modules/event/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:cc="http://web.resource.org/cc/" xmlns:rss="http://purl.org/rss/1.0/" xmlns="http://purl.org/rss/1.0/" > <cc:License rdf:nodeID="license"> <dc:identifier rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/"/> <cc:requires rdf:resource="http://web.resource.org/cc/Attribution"/> <cc:requires rdf:resource="http://web.resource.org/cc/Notice"/> <cc:requires rdf:resource="http://web.resource.org/cc/ShareAlike"/> <cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/> <cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/> <cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/> <cc:prohibits rdf:resource="http://web.resource.org/cc/CommercialUse"/> </cc:License> <channel rdf:about="http://www.medev.ac.uk/interoperability/jobs_example.owl"> <title xml:lang="en-GB">Sample jobs RSS 1.0 feed.</title> <description xml:lang="en-GB"> Sample jobs feed using new schema definition. </description> <link>http://www.medev.ac.uk/resources/news/jobs/</link> <dc:date>2005-06-16T15:55:00Z</dc:date> <items> <rdf:Seq> <rdf:li rdf:resource="http://www.jobs.ac.uk/jobfiles/TH558.html"/> </rdf:Seq> </items> <cc:license rdf:nodeID="license"/> </channel> <item rdf:about="http://www.jobs.ac.uk/jobfiles/TH558.html"> <dc:format>text/html</dc:format> <dc:date>2004-07-30T17:30:00Z</dc:date> <dc:source rdf:resource="http://www.medev.ac.uk/resources/fundops/"/> <title xml:lang="en-GB">Clinical Lecturer in Endocrinology / Diabetes, Division Of Medical Sciences</title> <description xml:lang="en-GB"> Applications are invited for the post of Clinical Lecturer with a special interest in Endocrinology/ Diabetes. Possession of MRCP is essential. The post represents 1 of 4 General Medicine Endocrinology and Diabetes, which together provide a programme for higher medical training in these specialities. The successful applicant is likely to rotate between UHB Trust and Heartlands Trust. The post holder will have responsibility for the care of inpatients and outpatients with general medicine and diabetic and/ or endocrine problems, teaching of medical students and postgraduate students, and co-ordination of undergraduate medical examinations. Research is an important component of this post and it is hoped that the successful candidate will be able to join a programme of research in line with the current activities of the Division. At the last RAE, the University scored a 5 in hospital based clinical subjects and 6 in laboratory sciences establishing the Medical School in Birmingham as one of the premier in the UK. </description> <dc:subject>Medical Education</dc:subject> <jobs:advertises rdf:nodeID="vacancy_0"/> </item> <jobs:Vacancy rdf:nodeID="vacancy_0"> <title xml:lang="en-GB">Clinical Lecturer in Endocrinology / Diabetes, Division Of Medical Sciences</title> <jobs:contractduration><xsd:integer rdf:value="1695"/></jobs:contractduration> <jobs:salaryrange rdf:nodeID="salary_range_0"/> <jobs:applicationdeadline rdf:nodeID="application_deadline_0"/> <jobs:vacancywith rdf:resource="http://www.bham.ac.uk/"/> <jobs:applyto rdf:resource="http://www.personnel.bham.ac.uk/"/> <jobs:localreference rdf:value="M1012"/> </jobs:Vacancy> <jobs:SalaryRange rdf:nodeID="salary_range_0"> <jobs:minimumsalary><xsd:integer rdf:value="28307"/></jobs:minimumsalary> <jobs:maximumsalary><xsd:integer rdf:value="49042"/></jobs:maximumsalary> <jobs:currency rdf:value="GBP"/> <jobs:percentagefte><xsd:integer rdf:value="100"/></jobs:percentagefte> </jobs:SalaryRange> <jobs:ApplicationDeadline rdf:nodeID="aplication_deadline_0"> <event:enddate rdf:value="2004-07-30T17:30:00Z"/> </jobs:ApplicationDeadline> <jobs:Organization rdf:about="http://www.bham.ac.uk/"> <vcard:ORG rdf:parseType="Resource"> <vcard:Orgname xml:lang="en-GB">The University of Birmingham</vcard:Orgname> </vcard:ORG> </jobs:Organization> <jobs:Organization rdf:about="http://www.personnel.bham.ac.uk/"> <vcard:ORG rdf:parseType="Resource"> <vcard:Orgname xml:lang="en-GB">Personnel Services</vcard:Orgname> </vcard:ORG> <vcard:ADDR rdf:parseType="Resource"> <vcard:Street xml:lang="en-GB"> The University of Birmingham, Edgbaston </vcard:Street> <vcard:Locality xml:lang="en-GB">Birmingham</vcard:Locality> <vcard:Pcode>B15 2TT</vcard:Pcode> <vcard:Region rdf:type="http://www.rdn.ac.uk/publications/rdn-ltsn/geographic-coverage/" xml:lang="en-GB" rdf:value="UK"/> </vcard:ADDR> <vcard:TEL rdf:parseType="Resource"> <rdf:value>0121 415 9000</rdf:value> <rdf:type rdf:resource="http://www.w3.org/2001/vcard-rdf/3.0#voice"/> <rdf:type rdf:resource="http://www.w3.org/2001/vcard-rdf/3.0#work"/> </vcard:TEL> </jobs:Organization> </rdf:RDF>
Posted by pj at 12:51 PM | Comments (0)
February 09, 2009
Planet Feed Aggregator
Posted by pj at 11:53 AM | Comments (0)
August 03, 2006
Very cunning Python based Universal Feed Parser
Posted by pj at 12:51 PM | Comments (0)
December 02, 2005
RSS 0.91 to 1.0 converter
http://blogspace.com/rss/rss2rdf
Posted by pj at 12:04 PM
December 01, 2005
A Java RSS feed parser
java.net: Using RSS in JSP pages
Posted by pj at 04:26 PM
July 14, 2005
RSS 1.0 job vacancies module
I've put together an RSS 1.0 extension module for job vacancies:
- produced an RDFS definition for the module: http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/rss1.0jobsmodule
- produced a new example document: http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/fundops_example_rdf
- wrote the whole thing up on the MEDEV site:
http://www.medev.ac.uk/interoperability/rss/1.0/modules/jobs/
Posted by pj at 03:31 PM
June 22, 2005
Re-working the funding opportunities RSS module
I've spent the last week and a half re-working the funding opportunities RSS module so that the syntax fits with the rdf:nodeID way of doing things on the recommendation of Libby Miller. As part of this work for the DEL project I have:
- produced an RDFS definition for the module: http://www.medev.ac.uk/interoperability/rss/1.0/modules/fundops/rss1.0fundopsmodule
- produced a new example document: http://www.medev.ac.uk/fundops_example.rdf
- written some XSLT to transform the comments and specs in the RDFS into HTML:
http://www.medev.ac.uk/rdfs2html.xsl
- written the whole thing up on the MEDEV site:
http://www.medev.ac.uk/interoperability/rss/1.0/modules/fundops/0.2/
Posted by pj at 03:44 PM
May 27, 2005
Python based RSS and Atom feed parser
SourceForge.net: Project Info - Universal Feed Parser
Posted by pj at 11:54 AM
April 13, 2005
Merging multiple RSS feeds
Suzanne thought it would be a good idea if we could merge multiple news feeds from BIOME, HS&P and HEALTH-01 for our joint portal page.
Whilst unconvinced of the requirement for such a thing I have come up with the following:
- http://www.ltsn-01.ac.uk/static/merge_feeds.php
To get a text/xml
view of it in your browser use:
- http://www.ltsn-01.ac.uk/static/merge_feeds.php?debug=1
The script is as follows:
- http://www.ltsn-01.ac.uk/static/merge_feeds.txt
Merging multiple RSS feeds into one involves de-duping based on link URLs in items and interleaving items so that they appear next to items of the same age in the final feed.
The script pulls our news feed and the feed from a blog we're hosting and represents them. In theory it can handle as many feeds as you want.
But why? I hear you ask.. Errm.. still not sure? Suzanne?
As a side effect of all this work, I was determined to get the feed to validate on http://feedvalidator.org.
It doesn't like my image references so those are gone from the feed, then it was a matter of getting the right content-type (application/rss+xml
), stripping annoying Windows meta characters from the feed, making sure there are no duplicate URLs, and I've UTF-8 encoded the final output for good measure.
- http://www.ltsn-01.ac.uk/static/strip_ms_chars.txt
Basically all the problems we've had with the LOM XML stuff.
I've done this with the rest of our feeds too and they now validate.
Posted by pj at 04:58 PM
April 12, 2005
Why 1.0 is best..
Posted by pj at 08:44 AM
Handling RSS 1.0 in PHP
Posted by pj at 08:43 AM
November 24, 2004
Photo metadata
I've finished the cataloguing tool for my photo album and formalised how the RDF is represented for the album, each collection, associated events and event attendees and then person depictions in the images themselves.
This is done within the framework of the CC License and Work model to assign a CC license to everything aswell.
I've also set up an RSS feed of the latest catalogued pictures and then hacked Feed2JS so that it pics up the image thumbnails if they are in the feed:
Paul Hollands - Photo Album - RSS
Posted by pj at 10:14 AM
November 23, 2004
RSS 1.0 module for photos
RDF Site Summary 1.0 Modules: Img
Posted by pj at 01:02 PM
November 11, 2004
Syndicated bookmarks in Mozilla 1.0
You can now bookmark RSS feeds in Mozilla 1.0, but you need the following tags in the headers of your pages to let it know there are feeds available:
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://minnesota.ncl.ac.uk/fuzzybuckets/atom.xml" />
Posted by pj at 12:44 PM
November 10, 2004
Feed2JS - RSS to Javascript code from Maricopa
< http://jade.mcli.dist.maricopa.edu/feed/ >
Posted by pj at 04:41 PM
November 02, 2004
Presentation about use of blogs and RSS for RLO peer review
This was posted by Phil Barker on the LTSN-Technical list and really set me on a different tack in my thinking about RLO evaluation, hence my current rabid bloggery:
<http://www.mcli.dist.maricopa.edu/show/nmc1003/>
Posted by pj at 03:23 PM
October 30, 2004
Blogging iTunes playlists - RSS feeds
Found this posting by Kimbro Staken about a Python script he's written which posts his iTunes playlist to his blog using in-line AppleScript and the MT XML-RPC.
< http://www.xmldatabases.org/movabletype/archives/000159.html >
Should be straight forward to retask it to post 'now playing' titles too?
Posted by pj at 10:58 AM
October 29, 2004
Magpie RSS parser for PHP
< http://magpierss.sourceforge.net/ >
Posted by pj at 03:36 PM