PHP Class Phergie_Plugin_FeedTicker, phergie

Inheritance: extends Phergie_Plugin_Abstract
Show file Open project: phergie/phergie

Protected Properties

Property Type Description
$channelsStatus Array with channels's last activity
$db resource PDO resource for a SQLite database.
$lastDeliveryTime Time of last delivery

Public Methods

Method Description
checkQueue ( String $channel ) : void Get unread items from the database and delivery then
createTables ( ) : void Creates the database table(s) (if they don't exist)
feedCheckingCallback ( ) : void Cron callback to check the feed
getFeed ( string $url, string $updated, string $etag = '' ) : FeedParser Check if the feed is valid, updated and returns the content + header
getUnreadItems ( String $channel ) : array Get all unread items from this channel
haveTable ( string $name ) : boolean Determines if a table exists
onJoin ( ) : void Tracks users joining a channel
onLoad ( ) : void Checks for dependencies, set default values and starts Cron callback
onPart ( ) : void Tracks users leaving a channel
onPrivmsg ( ) : void Tracks channel chat
onQuit ( ) : void Tracks users quitting a server
setChannelStatus ( String $channel ) : void Check if the bot is not alone in this channel and set new channel Status

Method Details

checkQueue() public method

Get unread items from the database and delivery then
public checkQueue ( String $channel ) : void
$channel String ToDo desc
return void

createTables() public method

Creates the database table(s) (if they don't exist)
public createTables ( ) : void
return void

feedCheckingCallback() public method

Cron callback to check the feed
public feedCheckingCallback ( ) : void
return void

getFeed() public method

Check if the feed is valid, updated and returns the content + header
public getFeed ( string $url, string $updated, string $etag = '' ) : FeedParser
$url string Feed URL
$updated string Last time this feed was checked
$etag string Last etag of this feed
return FeedParser

getUnreadItems() public method

Get all unread items from this channel
public getUnreadItems ( String $channel ) : array
$channel String ToDo desc
return array

haveTable() public method

Determines if a table exists
public haveTable ( string $name ) : boolean
$name string Table name
return boolean

onJoin() public method

Tracks users joining a channel
public onJoin ( ) : void
return void

onLoad() public method

Checks for dependencies, set default values and starts Cron callback
public onLoad ( ) : void
return void

onPart() public method

Tracks users leaving a channel
public onPart ( ) : void
return void

onPrivmsg() public method

Tracks channel chat
public onPrivmsg ( ) : void
return void

onQuit() public method

Tracks users quitting a server
public onQuit ( ) : void
return void

setChannelStatus() public method

Check if the bot is not alone in this channel and set new channel Status
public setChannelStatus ( String $channel ) : void
$channel String TODO desc
return void

Property Details

$channelsStatus protected property

Array with channels's last activity
protected $channelsStatus

$db protected property

PDO resource for a SQLite database.
protected resource $db
return resource

$lastDeliveryTime protected property

Time of last delivery
protected $lastDeliveryTime