Geeklog
[ class tree: Geeklog ] [ index: Geeklog ] [ all elements ]

Class: FeedParserBase

Source Location: /system/classes/syndication/feedparserbase.class.php

Class Overview


FeedParserBase provides an abstract ancestor class for feed parsers.


Author(s):

  • Michael Jervis (mike@fuckingbrit.com)

Copyright:

  • Michael Jervis 2004

Variables

Methods


Child classes:

Atom03
atom03 provides reading and writing of Atom 0.3 format syndication feeds.
Atom10
atom10 provides reading and writing of Atom 1.0 format syndication feeds.
RDF
RDF provides reading and writing of RDF 1.0 format syndication feeds.
RSS0x
rss0x provides reading and writing of RSS 0.91 format syndication feeds.
RSS20
rss20 provides reading and writing of RSS 2.0 format syndication feeds.

Class Details

[line 37]
FeedParserBase provides an abstract ancestor class for feed parsers.



Tags:

author:  Michael Jervis (mike@fuckingbrit.com)
copyright:  Michael Jervis 2004
abstract:  


[ Top ]


Class Variables

$articles =

[line 52]

An array of items.

This holds all the news from the source. This should be an array of associative arrays. Each item will have: title - The title URI - Link to the full story date - The date of the article Optional (pre-defined) items are: summary - Short version of article text - full version author - Who wrote the article



Type:   mixed


[ Top ]

$copyright =

[line 92]

copyright tag:


Type:   mixed


[ Top ]

$description =

[line 72]

The description of the feed


Type:   mixed


[ Top ]

$encoding =

[line 57]

Encoding tag for the XML declaration


Type:   mixed


[ Top ]

$extensions =

[line 112]

Additional tags to add.


Type:   mixed


[ Top ]

$feedlogo =

[line 102]

Image to link to the feed.


Type:   mixed


[ Top ]

$lang =

[line 62]

Language for the feed


Type:   mixed


[ Top ]

$namespaces =

[line 107]

Additional namespaces to add.


Type:   mixed


[ Top ]

$sitecontact =

[line 87]

Site contact


Type:   mixed


[ Top ]

$sitelink =

[line 82]

URL of the site


Type:   mixed


[ Top ]

$system =

[line 97]

system powering the feed


Type:   mixed


[ Top ]

$title =

[line 67]

Title for the feed


Type:   mixed


[ Top ]

$url =

[line 77]

The URL of the feed


Type:   mixed


[ Top ]

$_currentTag =

[line 117]

Stuff for parsing XML


Type:   mixed


[ Top ]



Class Methods


constructor FeedParserBase [line 119]

FeedParserBase FeedParserBase( )



[ Top ]

method charData [line 305]

void charData( $parser, $data)

Handles character data.

Called by the parserfactory during parsing.




Overridden in child classes as:

Atom03::charData()
Handles character data.
Atom10::charData()
Handles character data.
RDF::charData()
Handles character data.
RSS0x::charData()
Handles character data.
RSS20::charData()
Handles character data.

Parameters:

   $parser  
   $data  

[ Top ]

method createFeed [line 138]

void createFeed( string $fileName, [int $limit = ''])

Create a file for the stream

Writes the $items content to the file supplied in the format we have specified. Uses the (abstract) function formatArticle to return XML for an article.




Parameters:

string   $fileName   The fully qualified path to the file to create.
int   $limit   (optional) max number of items to write.

[ Top ]

method endElement [line 296]

void endElement( $parser, $name)

Handle the close of an XML element

Called by the parserfactory during parsing.




Overridden in child classes as:

Atom03::endElement()
Handle the close of an XML element
Atom10::endElement()
Handle the close of an XML element
RDF::endElement()
Handle the close of an XML element
RSS0x::endElement()
Handle the close of an XML element
RSS20::endElement()
Handle the close of an XML element

Parameters:

   $parser  
   $name  

[ Top ]

method startElement [line 287]

void startElement( $parser, $name, $attributes)

Handle the begining of an XML element

This is called from the parserfactory once the type of data has been determined. Standard XML_PARSER element handler.




Tags:

author:  Michael Jervis (mike@fuckingbrit.com)
copyright:  Michael Jervis 2004


Overridden in child classes as:

Atom03::startElement()
Handle the begining of an XML element
Atom10::startElement()
Handle the begining of an XML element
RDF::startElement()
Handle the begining of an XML element
RSS0x::startElement()
Handle the begining of an XML element
RSS20::startElement()
Handle the begining of an XML element

Parameters:

   $parser  
   $name  
   $attributes  

[ Top ]

method _feedFooter [line 272]

void _feedFooter( )

Return the formatted end of a feed.

just closes things off nicely.




Overridden in child classes as:

Atom03::_feedFooter()
Return the formatted end of a feed.
Atom10::_feedFooter()
Return the formatted end of a feed.
RDF::_feedFooter()
Return the formatted end of a feed.
RSS0x::_feedFooter()
Return the formatted end of a feed.
RSS20::_feedFooter()
Return the formatted end of a feed.

[ Top ]

method _feedHeader [line 227]

void _feedHeader( )

Return the formatted start of a feed.

This will start the xml and create header information about the feed itself.




Overridden in child classes as:

Atom03::_feedHeader()
Return the formatted start of a feed.
Atom10::_feedHeader()
Return the formatted start of a feed.
RDF::_feedHeader()
Return the formatted start of a feed.
RSS0x::_feedHeader()
Return the formatted start of a feed.
RSS20::_feedHeader()
Return the formatted start of a feed.

[ Top ]

method _formatArticle [line 185]

void _formatArticle( array $article)

Format an article into feed specific XML.

Takes an associative article array and turns it into an XML definition of an article.




Overridden in child classes as:

Atom03::_formatArticle()
Format an article into an Atom 0.3 <entry> tag.
Atom10::_formatArticle()
Format an article into an Atom 0.3 <entry> tag.
RDF::_formatArticle()
Format an article into an Atom 0.3 <entry> tag.
RSS0x::_formatArticle()
Format an article into an RSS 0.91 <item> tag.
RSS20::_formatArticle()
Format an article into an RSS 2.0 <item> tag.

Parameters:

array   $article   ASsociative array describing an article.

[ Top ]

method _injectExtendingTags [line 241]

void _injectExtendingTags( )

Inject extending tags into the feed header, if needed.



[ Top ]

method _injectNamespaces [line 255]

void _injectNamespaces( )

Inject XMLNS items into the feed master element, if needed.



[ Top ]

method _safeXML [line 216]

void _safeXML( string $string)

Make sure a string is safe to be chardata in an xml element



Parameters:

string   $string   the string to escape.

[ Top ]

method _writeFile [line 166]

void _writeFile( $fileName, $data)



Parameters:

   $fileName  
   $data  

[ Top ]


Documentation generated on Sat, 11 Feb 2012 02:07:33 -0500 by phpDocumentor 1.4.3