ocPortal Developer's Guide: RSS
» Return to Contentssources/rss.php
Global_functions_rss.php
Function summary
| string | extract_plain_links (array matches) |
| array | cleanup_date (string date) |
string extract_plain_links(array matches)
Used to turn plain-text links into real links.
Parameters…
| Name | matches |
|---|---|
| Description | The matches |
| Type | array |
Returns…
| Description | The replacement |
|---|---|
| Type | string |
array cleanup_date(string date)
Convert an ISO date into a timestamp.
Parameters…
| Name | date |
|---|---|
| Description | The ISO date |
| Type | string |
Returns…
| Description | If only one element, it contains the timestamp. Otherwise it is a pair: (string format, timestamp) |
|---|---|
| Type | array |
rss
Function summary
| void | rss (URLPATH url, boolean is_filesystem_path) |
| void | startNameSpace (object parser, string prefix, ?URLPATH uri) |
| void | endNameSpace (object parser) |
| void | startElement (object parser, string name, array attributes) |
| void | endElement (object parser) |
| void | startText (object parser, string data) |
| void | trueStartText (object parser, string data) |
void rss(URLPATH url, boolean is_filesystem_path)
Constructs the RSS reader: downloads the URL and parses it. Check $error after constructing.
Parameters…
| Name | url |
|---|---|
| Description | The URL to the RSS we will be reading |
| Type | URLPATH |
| Name | is_filesystem_path |
|---|---|
| Description | Whether the 'url' is actually a filesystem path |
| Default value | boolean-false |
| Type | boolean |
(No return value)
void startNameSpace(object parser, string prefix, ?URLPATH uri)
Standard PHP XML parser function.
Parameters…
| Name | parser |
|---|---|
| Description | The parser object (same as 'this') |
| Type | object |
| Name | prefix |
|---|---|
| Description | N/A |
| Type | string |
| Name | uri |
|---|---|
| Description | The URI of the name space we are entering (NULL: not given) |
| Default value | |
| Type | ?URLPATH |
(No return value)
void endNameSpace(object parser)
Standard PHP XML parser function.
Parameters…
| Name | parser |
|---|---|
| Description | The parser object (same as 'this') |
| Type | object |
(No return value)
void startElement(object parser, string name, array attributes)
Standard PHP XML parser function.
Parameters…
| Name | parser |
|---|---|
| Description | The parser object (same as 'this') |
| Type | object |
| Name | name |
|---|---|
| Description | The name of the element found |
| Type | string |
| Name | attributes |
|---|---|
| Description | Array of attributes of the element |
| Type | array |
(No return value)
void endElement(object parser)
Standard PHP XML parser function.
Parameters…
| Name | parser |
|---|---|
| Description | The parser object (same as 'this') |
| Type | object |
(No return value)
void startText(object parser, string data)
Standard PHP XML parser function.
Parameters…
| Name | parser |
|---|---|
| Description | The parser object (same as 'this') |
| Type | object |
| Name | data |
|---|---|
| Description | The text |
| Type | string |
(No return value)
void trueStartText(object parser, string data)
Parse the complete text of the inside of the tag.
Parameters…
| Name | parser |
|---|---|
| Description | The parser object (same as 'this') |
| Type | object |
| Name | data |
|---|---|
| Description | The text |
| Type | string |
(No return value)
sources/rss2.php
Global_functions_rss2.php
Function summary
| void | backend_cloud_script () |
| boolean | register_them (SHORT_TEXT path, ID_TEXT procedure, ID_TEXT protocol, integer port, string watching_channel) |
| void | backend_script () |
| array | get_enclosure_details (URLPATH url, URLPATH enclosure_url) |
void backend_cloud_script()
Handle cloud registrations.
Parameters…
(No return value)
boolean register_them(SHORT_TEXT path, ID_TEXT procedure, ID_TEXT protocol, integer port, string watching_channel)
Set up a cloud registration.
Parameters…
| Name | path |
|---|---|
| Description | The news category title |
| Type | SHORT_TEXT |
| Name | procedure |
|---|---|
| Description | The procedure they are interested in |
| Type | ID_TEXT |
| Name | protocol |
|---|---|
| Description | The protocol they are using |
| Type | ID_TEXT |
| Name | port |
|---|---|
| Description | The port to connect to them on |
| Type | integer |
| Name | watching_channel |
|---|---|
| Description | The channel they are interested in |
| Type | string |
Returns…
| Description | Success status |
|---|---|
| Type | boolean |
void backend_script()
Handle RSS/Atom output.
Parameters…
(No return value)
array get_enclosure_details(URLPATH url, URLPATH enclosure_url)
Get enclosure details from a URL, as efficiently as possible.
Parameters…
| Name | url |
|---|---|
| Description | The (possibly short) URL to get details for |
| Type | URLPATH |
| Name | enclosure_url |
|---|---|
| Description | The full URL to get details for |
| Type | URLPATH |
Returns…
| Description | A pair: the length of the data, the mime type |
|---|---|
| Type | array |




0 reviews: Unrated (average)
There have been no comments yet