Builds and outputs RSS feeds.

NOTE: Feed images are rarely dsplayed throughout most feed readers. Date function requires RFC822

package dstruct_rss
author Shane
todo This package could do with a re-write. Documentation isn't clear either.

 Methods

Class constructor.

__construct() 

Adding an {@link RSSItem}.

addItem(\RSSItem $item) 

Parameters

$item

\RSSItem

requires a valid RSSItem

Gets the Category.

getCategory() : string

Allows for the ability to add one or multiple categories that a channel belongs to

Returns

string

Gets the Copyright.

getCopyright() : string

The copyright notice for the content of the channel

Returns

string

Gets the Description.

getDescrip() : string

The description of the content of the channel

Returns

string

Gets the docs.

getDocs() : string

URL for the documentation for the format of the RSS feed

Returns

string

Gets the Generator.

getGenerator() : string

The program that creates the channel

Returns

string

Gets the Image.

getImage() : string

Gets an image for the content of the channel

Returns

string

Gets the Description of the Image.

getImageDescrip() : string

Returns

string

Gets the Height of the Image.

getImageHeight() : integer

Returns

integer

Gets the Title of the Image.

getImageTitle() : string

Returns

string

Gets the URL of the Image.

getImageURL() : string

Returns

string

Gets the Width of the Image.

getImageWidth() : integer

Returns

integer

Get number of items in feed?

getItemAmount() : string
see \setItemAmount()

Returns

string

Gets the language of the content in the channel.

getLanguage() : string

Returns

string

Gets the last build date of this object.

getLastBuildDate() : integer

Should be UTS date?

Returns

integer

Gets the ManagingEditor.

getManagingEditor() : string

An e-mail address for the editorial content producer

Returns

string

Gets the pub date.

getPubDateUTS() : integer

A date that represents the publication date for the content in the channel

Returns

integer

Gets the rating.

getRating() : string

PICS rating for the channel

Returns

string

Gets the Skip Days.

getSkipDays() : integer

Tells aggregators to skip for specified days.

Returns

integer

Gets the Skip Hours.

getSkipHours() : integer

Tells aggregators to skip for specified hours

Returns

integer

Gets the ttl.

getTTL() : integer

(Time to Live) which tells the length of time the channel can be cached. In seconds?

Returns

integer

Gets the text input.

getTextInput() : string

A text input field that can be displayed with the channel

Returns

string

Gets the Title.

getTitle() : string

The title of the content of the channel

Returns

string

Gets the URL.

getURL() : string

Gets the url of the channel

Returns

string

Gets the WebMaster.

getWebMaster() : string

An e-mail address for the web master

Returns

string

Outputs feed.

output() 

Creates the rss feed xml.

Save As File.

saveAsFile(string $filepath, string $filename) 

Saves the file to the specified filepath Function checks for valid path If the file already exists, then it is overwritten, else a new file is created Checks for backslash at the end of the filepath, if returned false, then added

Parameters

$filepath

string

$filename

string

Set the category.

setCategory(string $category) 

Allows for the ability to add one or multiple categories that a channel belongs to

Parameters

$category

string

Set the copyright.

setCopyright(string $copyright) 

The copyright notice for the content of the channel

Parameters

$copyright

string

Set the Description.

setDescrip(string $descrip) 

Sets a description for the channel

Parameters

$descrip

string

Set the Docs.

setDocs(string $docs) 

URL for the documentation for the format of the RSS feed

Parameters

$docs

string

Set the generator.

setGenerator(string $generator) 

The program that creates the channel

Parameters

$generator

string

Set the Description of the Image.

setImageDescrip(string $imagedescrip) 

Sets an image in the channel

Parameters

$imagedescrip

string

Set the Height of the Image.

setImageHeight(integer $imageheight) 

Sets an image in the channel

Parameters

$imageheight

integer

Set the Title of the Image.

setImageTitle(string $imagetitle) 

Sets an image in the channel

Parameters

$imagetitle

string

Set the URL of the Image.

setImageURL(string $imageurl) 

Sets an image in the channel

Parameters

$imageurl

string

Set the Width of the Image.

setImageWidth(integer $imagewidth) 

Sets an image in the channel

Parameters

$imagewidth

integer

Set the Amount of items.

setItemAmount(integer $itemamount) 

The number of Items to be displayed in the Feed, Default is 200.

Parameters

$itemamount

integer

Set the language.

setLanguage(string $language) 

Sets the language of the content in the channel.

todo What format??

Parameters

$language

string

Set the last build date.

setLastBuildDate(integer $lastbuilddate) 

The last date and time that the content was changed

Parameters

$lastbuilddate

integer

UTS timestamp

Set the managing editor.

setManagingEditor(string $managingeditor) 

An e-mail address for the editorial content producer

Parameters

$managingeditor

string

Set the publication date of this item as string.

setPubDateString(string $pubdate) 

The pubDate is the date that the item was published Can be entered in any format getPubDateString method changes to UTS and calls getPubDateUTS method to format

Parameters

$pubdate

string

Set the publication date of this item as UTS.

setPubDateUTS(integer $pubdate) 

The pubDate is the date that the item was published. Entered in UTS and formated to RFC822

Parameters

$pubdate

integer

Set the rating.

setRating(string $rating) 

PICs rating for the channel

Parameters

$rating

string

Set the skip days.

setSkipDays(integer $skipdays) 

Tells aggregators to skip for specified day

todo What does this mean?

Parameters

$skipdays

integer

Set the skip hours.

setSkipHours(integer $skiphours) 

Tells aggregators to skip for specified hour.

todo What does this mean?

Parameters

$skiphours

integer

Set the ttl.

setTTL(integer $ttl) 

(Time To Live) which tells the length of time the channel can be cached

Parameters

$ttl

integer

In seconds?

Set the text input.

setTextInput(string $textinput) 

A text nput field that can be displayed with the channel

Parameters

$textinput

string

Set the Title.

setTitle(string $title) 

Sets a title of the channel

Parameters

$title

string

Set the URL.

setURL(string $url) 

Sets the url for the channel

Parameters

$url

string

Set the web master.

setWebMaster(string $webmaster) 

An e-mail address for the web master

Parameters

$webmaster

string

Sort the feed items.

sortItems(string $element, string $sort_direction, string $caseinsensitive, string $params, string $astime) 
see \ObjCollection::sortObjects()

Parameters

$element

string

Element to sort by

$sort_direction

string

$caseinsensitive

string

$params

string

$astime

string

RSS Feed Validator.

validate() : boolean

Returns false if an RSS Feed title, description, URL or pubdate have not been entered.

todo Should be more specific about what is missing!
todo Should throw an error, rather than use trigger_error()

Returns

booleanActually, only returns true if successful, otherwise, triggers and error.

 Properties

 

$category : string
   

$descrip : string
 

$docs : string
 

$generator : string
 

$image : string
 

$imagedescrip : string
 

$imageheight : integer
   

$imagetitle : string
 

$imageurl : string
 

$imagewidth : integer
 

$itemamount 
 

$items : \RSSItems
 

$language : string
 

$lastbuilddate : string
 

$managingeditor : string
 

$pubdate : integer
 

$rating : string
 

$skipdays : string
 

$skiphours : integer
 

$textinput : string
 

$title : string
 

$ttl : integer
see \getTTL()
 

$url : string
see \getURL()
 

$webmaster : string