Almost every aikido (or budo) organization has its own website with a list of seminars. Number of organizations, websites and seminars increases and one can easily miss interesting events. The goal of this project is to enable automatic interchange of seminar information so that it would be possible to syndicate seminars among aikido websites.
The data interchange is based on format RSS1.0, which is commonly used for a web article syndication. This format was extended so that our it can carry seminar information. This extended format we call RSeminarS.
Moreover, the programming library (now only in PHP) to work with this format was implemented. This library can generate and process documents in RSeminarS.
All neccessary tools (RSeminarS specification and programming libraries) you can freely download in section download.
RSeminarS features:
RSeminarS_php_091.zip - programming library for RSeminarS (in PHP) with samples.
Following simple examples illustrates use of RSeminarS programming library. More detail samples can be found in the library release.
// include neccessary classes
require("RSeminarS/RSeminarS_generator.php");
// create feed generator
$rss = new RSeminarSGenerator();
mysql_select_db($dbHost, $dbUser, $dbPass);
$res1 = mysql_query("SELECT * FROM seminars ORDER BY start_date DESC");
while ($row1 = mysql_fetch_array($res1)) {
$sem = new Seminar();
// set seminar properties
$sem->startDate->setDate(row1['start_day'], row1['start_month'], row1['start_year']);
$sem->endDate->setDate(row1['end_day'], row1['end_month'], row1['end_year']);
$sem->location = row1['location'];
// $sem->link = 'http://www.mywebsite.net/seminars/particularSeminarPage.html';
// $sem->type = 'Aikido seminar';
// $sem->organizer = 'An organization that organizes this event.';
// now teachers
$res2 = mysql_query("SELECT * FROM teachers WHERE id_seminar = $row1['id']");
while ($row2 = mysql_fetch_array($res2)) {
$teacher = new Teacher();
$teacher->name = $row2['name'];
$teacher->qualification = $row2['qualification'];
$sem->addTeacher($teacher);
}
// add seminar to feed
$rss->addSeminar($sem);
}
header('Content-Type: text/xml');
// write feed to output
echo $rss->createFeed();
// include parser library
require('RSeminarS/RSeminarS_parser.php');
// create feed from RSeminarS document at a specified url
$feed = new RSeminarSParser('http://www.sspa.sk/rss/seminars.en.rss');
// write channel properties
echo '<b>channel title:</b> '. $feed->getChannelTitle().'<br />';
echo '<b>channel description:</b> '. $feed->getChannelDescription().'<br />';
echo '<b>channel link:</b> '. $feed->getChannelLink().'<br />';
// get all seminars from feed
$seminars = $feed->getSeminars();
// go through all seminars and process them
foreach ($seminars as $seminar) {
// write seminar properties - type, date, location
echo '<b>seminar type:</b> '. $seminar->type.'<br />';
echo '<b>seminar date</b>: '. $seminar->startDate->getLocaleString('en').' - '.
$seminar->endDate->getLocaleString('en').'<br />';
echo '<b>seminar location:</b> '.$seminar->location.'<br />';
// process teachers
if (sizeof($seminar->teachers) > 0) {
echo '<b>teachers:</b><ul>';
// go through all teachers in seminar and write their name and qualification (if there is any)
foreach ($seminar->teachers as $teacher) {
echo '<li>'.$teacher->name;
echo ($teacher->qualification!='')?' ('.$teacher->qualification.')':'';
echo '</li>';
}
echo '</ul>';
}
// write seminar note
echo '<b>seminar note:</b><br />'.$seminar->note.'<br />';
// write seminar link
echo '<b>...seminar detail at </b><a href="'.$seminar->link.'" target="_blank">'.$seminar->link.'</a><br />';
}
We are testing this project on the information interchange between two aikido organization websites. One is SSPA (Slovak organization) and another one ÈFAI (Czech organization).
On both websites a RSeminarS document is generated with seminars from database (RSeminarS at SSPA, RSeminarS at ÈFAI).
Then RSeminarS document from ÈFAI is fetched to SSPA website, the information about seminars is processed and added to the list of seminars at SSPA.
Seminars from SSPA database are presented in ÈFAI list in the same way.
Project is distributed under GPL.