Property | Type | Description | |
---|---|---|---|
$cache | Phergie_Plugin_Cache | Cache object to store cached URLs to prevent spamming, especially with more than one bot on the same channel. | |
$errorMessage | |||
$errorStatus | boolean | Flag that is set to true by the custom error handler if an HTTP error code has been received | |
$expire | integer | Setting it to 0 or below disables the cache expiration | |
$limit | integer | Setting it to 0 or below disables the cache limit | |
$renderers | Array of renderers | ||
$shortener | Shortener object | ||
$sslFallback | boolean | Flag that determines if the plugin will fall back to using an HTTP stream when a URL using SSL is detected and OpenSSL support isn't available in the PHP installation in use |
Method | Description | |
---|---|---|
findUrls ( string $message ) : array | Detect URLs in a given string. | |
getTitle ( string $url ) : string | Returns the title of the given page | |
onAction ( ) : void | Checks an incoming message for the presence of a URL and, if one is found, responds with its title if it is an HTML document and the shortened equivalent of its original URL if it meets length requirements. | |
onLoad ( ) : void | Checks for dependencies. | |
onPrivmsg ( ) : void | Checks an incoming message for the presence of a URL and, if one is found, responds with its title if it is an HTML document and the shortened equivalent of its original URL if it meets length requirements. | |
preDispatch ( ) : void | Processes events before they are dispatched and tries to shorten any urls in the text | |
registerRenderer ( object $obj ) : void | Add a renderer to the stack |
Method | Description | |
---|---|---|
checkUrlCache ( string $url, string $shortenedUrl ) : boolean | Checks a given URL (+shortened) against the cache to verify if they were previously posted on the channel. | |
checkValidIP ( string $ip ) : boolean | Checks the given string to see if its a valid IP4 address | |
debug ( string $msg ) : void | Output a debug message | |
decode ( string $str, integer $trim = null ) : string | Transliterates a UTF-8 string into corresponding ASCII characters and truncates and appends an ellipsis to the string if it exceeds a given length. | |
getUrlChecksum ( string $url ) : string | Takes a url, parses and cleans the URL without of all the junk and then return the hex checksum of the url. | |
glueUrl ( string $uri, string $base = false ) : string | Parses a given URI and then glues it back together in the proper format. | |
handleMsg ( ) : void | Handles message events and responds with url titles. | |
parseUrl ( string $url ) : array | Parses a given URI and procceses the output to remove redundant or missing values. | |
updateUrlCache ( string $url, string $shortenedUrl ) : boolean | Updates the cache and adds the given URL (+shortened) to the cache. It also handles cleaning the cache of old entries as well. |
protected checkValidIP ( string $ip ) : boolean | ||
$ip | string | the ip to validate |
return | boolean |
protected getUrlChecksum ( string $url ) : string | ||
$url | string | url to checksum |
return | string | the hex checksum of the cleaned url |
public preDispatch ( ) : void | ||
return | void |
public registerRenderer ( object $obj ) : void | ||
$obj | object | the renderer to add |
return | void |
protected Phergie_Plugin_Cache $cache | ||
return | Phergie_Plugin_Cache |
protected bool $errorStatus | ||
return | boolean |
protected int $expire | ||
return | integer |
protected int $limit | ||
return | integer |
protected bool $sslFallback | ||
return | boolean |