You are here

function _parser_simplepie_get_parser in FeedAPI 5

Same name and namespace in other branches
  1. 6 parser_simplepie/parser_simplepie.module \_parser_simplepie_get_parser()

Set SimplePie setting

Parameters

$url: The feed's url

Return value

SimplePie object

2 calls to _parser_simplepie_get_parser()
parser_simplepie_feedapi_feed in parser_simplepie/parser_simplepie.module
Implementation of hook_feedapi_feed().
_parser_simplepie_feedapi_parse in parser_simplepie/parser_simplepie.module
Parsing the feed

File

parser_simplepie/parser_simplepie.module, line 220
Parse the incoming URL with SimplePie then provide a data structure of the feed

Code

function _parser_simplepie_get_parser($url) {
  require_once drupal_get_path('module', 'parser_simplepie') . '/simplepie.inc';
  $parser = new SimplePie();
  $parser
    ->set_feed_url($url);
  $parser
    ->set_timeout(15);
  $parser
    ->set_stupidly_fast(TRUE);
  $parser
    ->encode_instead_of_strip(FALSE);
  $cache_location = _parser_simplepie_sanitize_cache();
  $parser
    ->enable_cache($cache_location !== FALSE ? TRUE : FALSE);
  $parser
    ->set_cache_location($cache_location);
  $parser
    ->init();
  return $parser;
}