dolibarr 21.0.0-beta
|
Class to parse RSS files. More...
Public Member Functions | |
__construct ($db) | |
Constructor. | |
getFormat () | |
getFormat | |
getUrlRss () | |
getUrlRss | |
getLanguage () | |
getLanguage | |
getGenerator () | |
getGenerator | |
getCopyright () | |
getCopyright | |
getLastBuildDate () | |
getLastBuildDate | |
getImageUrl () | |
getImageUrl | |
getLink () | |
getLink | |
getTitle () | |
getTitle | |
getDescription () | |
getDescription | |
getLastFetchDate () | |
getLastFetchDate | |
getItems () | |
getItems | |
parser ($urlRSS, $maxNb=0, $cachedelay=60, $cachedir='') | |
Parse rss URL. | |
feed_start_element ($p, $element, $attrs) | |
Triggered when opened tag is found. | |
feed_cdata ($p, $text) | |
Triggered when CDATA is found. | |
feed_end_element ($p, $el) | |
Triggered when closed tag is found. | |
concat (&$str1, $str2="") | |
To concat 2 strings with no warning if an operand is not defined. | |
append_content ($text) | |
Enter description here ... | |
append ($el, $text) | |
smart append - field and namespace aware | |
Private Member Functions | |
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 31 of file rssparser.class.php.
RssParser::__construct | ( | $db | ) |
Constructor.
Definition at line 156 of file rssparser.class.php.
RssParser::append | ( | $el, | |
$text ) |
smart append - field and namespace aware
string | $el | El |
string | $text | Text |
Definition at line 797 of file rssparser.class.php.
References concat().
Referenced by feed_cdata(), and feed_start_element().
RssParser::append_content | ( | $text | ) |
Enter description here ...
string | $text | Text |
Definition at line 780 of file rssparser.class.php.
References concat().
Referenced by feed_cdata(), feed_end_element(), and feed_start_element().
RssParser::concat | ( | & | $str1, |
$str2 = "" ) |
To concat 2 strings with no warning if an operand is not defined.
string | $str1 | Str1 |
string | $str2 | Str2 |
Definition at line 764 of file rssparser.class.php.
Referenced by append(), and append_content().
RssParser::feed_cdata | ( | $p, | |
$text ) |
Triggered when CDATA is found.
string | $p | P |
string | $text | Tag |
Definition at line 703 of file rssparser.class.php.
References append(), and append_content().
RssParser::feed_end_element | ( | $p, | |
$el ) |
Triggered when closed tag is found.
string | $p | P |
string | $el | Tag |
Definition at line 722 of file rssparser.class.php.
References append_content().
RssParser::feed_start_element | ( | $p, | |
$element, | |||
$attrs ) |
Triggered when opened tag is found.
string | $p | Start |
string | $element | Tag |
array<string,mixed|mixed[]> | $attrs Attributes of tags |
Definition at line 615 of file rssparser.class.php.
References append(), and append_content().
|
private |
Return a URL to a image of the given ATOM feed.
array<string,mixed> | $feed The ATOM feed that possible contain a link to a logo or icon |
Definition at line 862 of file rssparser.class.php.
Referenced by parser().
|
private |
Return a description/summary for one item from a ATOM feed.
array<string,mixed> | $item A parsed item of a ATOM feed | |
int | $maxlength | (optional) The maximum length for the description |
Definition at line 832 of file rssparser.class.php.
Referenced by parser().
RssParser::getCopyright | ( | ) |
RssParser::getDescription | ( | ) |
RssParser::getFormat | ( | ) |
RssParser::getGenerator | ( | ) |
RssParser::getImageUrl | ( | ) |
RssParser::getItems | ( | ) |
getItems
Definition at line 266 of file rssparser.class.php.
RssParser::getLanguage | ( | ) |
RssParser::getLastBuildDate | ( | ) |
RssParser::getLastFetchDate | ( | ) |
RssParser::getLink | ( | ) |
RssParser::getTitle | ( | ) |
RssParser::getUrlRss | ( | ) |
RssParser::parser | ( | $urlRSS, | |
$maxNb = 0, | |||
$cachedelay = 60, | |||
$cachedir = '' ) |
Parse rss URL.
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) |
Definition at line 280 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(), getDolGlobalString(), getURLContent(), sanitizeVal(), and xml2php().