set_feed_url(array( 'http://wiki.directi.com/createrssfeed.action?types=page&sort=modified&showContent=true&spaces=REC&labelString=publish&rssType=rss2&maxResults=10&timeSpan=5&publicFeed=true&title=Directi+Wiki&showDiff=false', 'http://blog.resellerclub.com/category/mr/feed', 'http://blog.logicboxes.com/category/mr/feed/', 'http://blog.directi.com/category/mr/feed/' )); $feed->handle_content_type(); $feed->init(); $feed->set_item_limit(1); // excerpt = true/false // $excerpt = $_GET['excerpt']; // excerptcount = 130,200 $excerptcount = 250; // itemcount = 5,10,15 $itemcount = 3; // container ID = di_wiki_wrapper, di-blog-div // $containerid = $_GET['containerid']; function preview_text($TEXT, $LIMIT, $TAGS = 0) { // trim text $TEXT = trim($TEXT); // strip tags if preview is without html if ($TAGS == 0) $TEXT = preg_replace('/\s\s+/', ' ', strip_tags($TEXT)); // if strlen is smaller than limit return if (strlen($TEXT) < $LIMIT) return $TEXT; if ($TAGS == 0) return substr($TEXT, 0, $LIMIT) . " ..."; else { $COUNTER = 0; for ($i = 0; $i<= strlen($TEXT); $i++) { if ($TEXT{$i} == "<") $STOP = 1; if ($STOP != 1) { $COUNTER++; } if ($TEXT{$i} == ">") $STOP = 0; $RETURN .= $TEXT{$i}; if ($COUNTER >= $LIMIT && $TEXT{$i} == " ") break; } // $RETURN = preg_replace('/Page edited by [a-zA-Z]+ [a-zA-Z]+ /','',$RETURN); return $RETURN ."..."; } } header("Content-Type: application/rss+xml"); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "Directi Press/Media Articles\n"; echo "http://wiki.directi.com/display/mr/\n"; echo "This is an aggregated feed of Directi Press/Media Articles.\n"; echo "".date('r')."\n"; echo "en-us\n"; $new_lines = array("\r\n", "\n", "\r"); $result_set = $feed->get_items(); if ($itemcount) { $count = $itemcount; } else { $count = 5; } for ($iteration=0;$iteration < $count;$iteration++) { $item = $result_set[$iteration]; echo "\n"; echo "".$item->get_title()."\n"; echo "".$item->get_link()."\n"; echo "".$item->get_link()."\n"; echo "".$item->get_date('r')."\n"; echo "".str_replace($new_lines,'',preview_text($item->get_content(), $excerptcount))."\n"; echo "\n"; } echo "\n"; echo "\n"; ?>