Reply to comment

This post provides a little bit of documentation about the feedapi.
There is no setting to choose how long your feed items are cached. The default cache time is 3600 sec. Which mean when you re testing the feedapi your feed isnt updated immediatly.
I made a feature request to include this. You can allways adapt the parser simple pie module. Following function is adapted wich sets the cache time to 150sec. (feedapi/parser_simplepie/parser_simplepie.module line 187)

<?php
/**
 * Set SimplePie setting
 * @param $url
 *  The feed's url
 * @return
 *  SimplePie object
 */
function _parser_simplepie_get_parser($url$enable_cache TRUE) {
  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 $enable_cache FALSE);
  
//This sets the cache time
  
$parser->set_cache_duration(150);

  
$parser->set_cache_location($cache_location);
  
$parser->init();
  return 
$parser;
}
?>

Something intersting I saw was the technique which was used to determine if a serie of feeds was changed and needed an update. All the feed items where serialized and hashed with the md5 algoritme. The old hash string was compared with the new one to see if something was updated.
From feedapi module: line 1166-1173

<?php
  $hash_old 
$feed->hash;
  
$feed _feedapi_call_parsers($feed$feed->parsers$feed->half_done);
  if (
is_object($feed)) {
    
$feed->hash md5(serialize($feed->items));
  }
  
  
// Step 3: See, whether feed has been modified.
  
if ($feed === FALSE || $hash_old == $feed->hash) {
    
//...
?>

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><img><p><b><i><table><th><tr><td><blockquote><br /><img /><tbody><span><strike>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <codes>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.