#!/usr/bin/perl -w
# $Id: testrssnote,v 1.2 2005/09/21 17:15:18 ianb Exp $
# Ian Beckwith <ianb@nessie.mcc.ac.uk>
#

use strict;
use XML::PFIF;
use XML::PFIF::Person;
use XML::PFIF::Note;

my $p=new XML::PFIF::Person;

$p->person_record_id("salesforce.com/a0030000001TRYR");
$p->first_name("KATHERINE");
$p->last_name("DOE");


my $n=$p->add_note({note_record_id=>"icrc.org/162537.1",
	      entry_date=>"2005-09-03T23:00:00Z",
	      author_name=>"Mary Jacobs",
	      author_email=>"mdj\@geocities.com",
	      author_phone=>"(555) 736-1148",
	      source_date=>"2005-09-03T22:07:59Z",
	      found=>"false",
	      last_known_location=>"at home in New Orleans",
	      text=>"\nIf you have any information on Katie, please contact me.\n"});

$n=$p->add_note();


$n->note_record_id("salesforce.com/00N30000000tO5N");
$n->entry_date("2005-09-03T20:52:25Z");
$n->author_name("Jane Peters");
$n->author_email("jp123\@example.com");
$n->author_phone("(555) 493-2342");
$n->source_date("2005-09-03T20:52:25Z");
$n->found("true");
$n->email_of_found_person("katie_doe\@randomsite.biz");
$n->phone_of_found_person("(555) 904-9095");
$n->last_known_location("on a cot somewhere, AstroDome, Houston TX");
$n->text("\nI spoke to Katie on the phone today at around noon EST.\n".
	"She is tired and worried but otherwise okay.\n");



print $p->start_rss();
print $p->start_channel({title=> $p->first_name() ." ". $p->last_name(),
			 description=>"Note feed for ". $p->first_name() ." ". $p->last_name(),
			 lastBuildDate=> $p->now(),
			 link=>"http://www.afallstardjs.com/salesforce-feed.php?00N30000000tO5N"});

for my $note (sort XML::PFIF::Person::sort_notes $p->notes())
{
    print $note->to_rss();
}



print $n->end_channel();
print $n->end_rss();

