[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/libraries/magpierss/ -> rss_parse.inc (summary)

Project:     MagpieRSS: a simple RSS integration tool File:        rss_parse.inc  - parse an RSS or Atom feed return as a simple object. Handles RSS 0.9x, RSS 2.0, RSS 1.0, and Atom 0.3

Author: Kellan Elliott-McCrea <[email protected]>
License: GPL
Version: 0.7a
File Size: 605 lines (20 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 1 file
 libraries/magpierss/rss_utils.inc

Defines 1 class

MagpieRSS:: (17 methods):
  MagpieRSS()
  feed_start_element()
  feed_cdata()
  feed_end_element()
  concat()
  append_content()
  append()
  normalize()
  is_rss()
  is_atom()
  create_parser()
  php5_create_parser()
  php4_create_parser()
  known_encoding()
  error()
  map_attrs()
  array_change_key_case()


Class: MagpieRSS  - X-Ref

Hybrid parser, and object, takes RSS as a string and returns a simple object.

see: rss_fetch.inc for a simpler interface with integrated caching support

MagpieRSS($source, $output_encoding='UTF-8', $input_encoding=null, $detect_encoding=true)   X-Ref
Set up XML parser, parse source, and return populated RSS object..

param: string $source           string containing the RSS to be parsed
param: string $output_encoding  output the parsed RSS in this character
param: string $input_encoding   the character set of the incoming RSS source.
param: bool   $detect_encoding  if false Magpie won't attempt to detect

feed_start_element($p, $element, &$attrs)   X-Ref
No description

feed_cdata($p, $text)   X-Ref
No description

feed_end_element($p, $el)   X-Ref
No description

concat(&$str1, $str2="")   X-Ref
No description

append_content($text)   X-Ref
No description

append($el, $text)   X-Ref
No description

normalize()   X-Ref
No description

is_rss()   X-Ref
No description

is_atom()   X-Ref
No description

create_parser($source, $out_enc, $in_enc, $detect)   X-Ref
return XML parser, and possibly re-encoded source


php5_create_parser($in_enc, $detect)   X-Ref
Instantiate an XML parser under PHP5

PHP5 will do a fine job of detecting input encoding
if passed an empty string as the encoding.

All hail libxml2!


php4_create_parser($source, $in_enc, $detect)   X-Ref
Instaniate an XML parser under PHP4

Unfortunately PHP4's support for character encodings
and especially XML and character encodings sucks.  As
long as the documents you parse only contain characters
from the ISO-8859-1 character set (a superset of ASCII,
and a subset of UTF-8) you're fine.  However once you
step out of that comfy little world things get mad, bad,
and dangerous to know.

The following code is based on SJM's work with FoF

known_encoding($enc)   X-Ref
No description

error($errormsg, $lvl=E_USER_WARNING)   X-Ref
No description

map_attrs($k, $v)   X-Ref
No description

array_change_key_case($array,$case=CASE_LOWER)   X-Ref
No description



Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1