You are here

function parser_simplepie_simplify_raw_item in FeedAPI 6

Same name and namespace in other branches
  1. 5 parser_simplepie/parser_simplepie.module \parser_simplepie_simplify_raw_item()

This function simplifies a raw feed item.

File

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

Code

function parser_simplepie_simplify_raw_item($raw_item) {
  if ($item = array_shift($raw_item['child'])) {
    foreach ($item as $k => $v) {
      if (count($item[$k]) > 1) {
        foreach ($item[$k] as $j => $u) {
          $simple_item[$k][] = $item[$k][$j]['data'];
        }
      }
      else {
        $simple_item[$k] = $item[$k][0]['data'];
      }
    }
    return $simple_item;
  }
  return $raw_item;
}