Class to parse RSS files.
More...
|
| getAtomItemDescription (array $item, $maxlength=500) |
| Return a description/summary for one item from a ATOM feed.
|
|
| getAtomImageUrl (array $feed) |
| Return a URL to a image of the given ATOM feed.
|
|
Class to parse RSS files.
Definition at line 27 of file rssparser.class.php.
◆ __construct()
RssParser::__construct |
( |
| $db | ) |
|
◆ append()
RssParser::append |
( |
| $el, |
|
|
| $text ) |
◆ append_content()
RssParser::append_content |
( |
| $text | ) |
|
◆ concat()
RssParser::concat |
( |
& | $str1, |
|
|
| $str2 = "" ) |
To concat 2 strings with no warning if an operand is not defined.
- Parameters
-
string | $str1 | Str1 |
string | $str2 | Str2 |
- Returns
- string String cancatenated
Definition at line 676 of file rssparser.class.php.
Referenced by append(), and append_content().
◆ feed_cdata()
RssParser::feed_cdata |
( |
| $p, |
|
|
| $text ) |
◆ feed_end_element()
RssParser::feed_end_element |
( |
| $p, |
|
|
| $el ) |
◆ feed_start_element()
RssParser::feed_start_element |
( |
| $p, |
|
|
| $element, |
|
|
| $attrs ) |
◆ getAtomImageUrl()
RssParser::getAtomImageUrl |
( |
array | $feed | ) |
|
|
private |
Return a URL to a image of the given ATOM feed.
- Parameters
-
array | $feed | The ATOM feed that possible contain a link to a logo or icon |
- Returns
- string A URL to a image from a ATOM feed when found, otherwise a empty string
Definition at line 774 of file rssparser.class.php.
Referenced by parser().
◆ getAtomItemDescription()
RssParser::getAtomItemDescription |
( |
array | $item, |
|
|
| $maxlength = 500 ) |
|
private |
Return a description/summary for one item from a ATOM feed.
- Parameters
-
array | $item | A parsed item of a ATOM feed |
int | $maxlength | (optional) The maximum length for the description |
- Returns
- string A summary description
Definition at line 744 of file rssparser.class.php.
Referenced by parser().
◆ getCopyright()
RssParser::getCopyright |
( |
| ) |
|
◆ getDescription()
RssParser::getDescription |
( |
| ) |
|
◆ getFormat()
◆ getGenerator()
RssParser::getGenerator |
( |
| ) |
|
◆ getImageUrl()
RssParser::getImageUrl |
( |
| ) |
|
◆ getItems()
◆ getLanguage()
RssParser::getLanguage |
( |
| ) |
|
◆ getLastBuildDate()
RssParser::getLastBuildDate |
( |
| ) |
|
◆ getLastFetchDate()
RssParser::getLastFetchDate |
( |
| ) |
|
◆ getLink()
◆ getTitle()
◆ getUrlRss()
◆ parser()
RssParser::parser |
( |
| $urlRSS, |
|
|
| $maxNb = 0, |
|
|
| $cachedelay = 60, |
|
|
| $cachedir = '' ) |
Parse rss URL.
- Parameters
-
string | $urlRSS | Url to parse |
int | $maxNb | Max nb of records to get (0 for no limit) |
int | $cachedelay | 0=No cache, nb of seconds we accept cache files (cachedir must also be defined) |
string | $cachedir | Directory where to save cache file (For example $conf->externalrss->dir_temp) |
- Returns
- int <0 if KO, >0 if OK
Definition at line 197 of file rssparser.class.php.
References dol_filemtime(), dol_hash(), dol_is_dir(), dol_is_url(), dol_mkdir(), dol_now(), dol_syslog(), dolChmod(), getAtomImageUrl(), getAtomItemDescription(), getURLContent(), sanitizeVal(), and xml2php().
The documentation for this class was generated from the following file: