link["href"]; if ( $link != "" ) { $document = new Document($link, true); $img = $document->find(".img-comic-container")[0]->find(".img-comic-link")[0]->find("img")[0]; $time = (string)$node->updated; $doc = new DOMDocument(); $doc->loadHTML($img); $xpath = new DOMXPath($doc); $src = $xpath->evaluate("string(//img/@src)"); $title = $xpath->evaluate("string(//img/@alt)"); $count++; $return_values[$count]["title"] = $title; $return_values[$count]["link"] = $src; $return_values[$count]["time"] = $time; $return_values[$count]["description"] = "".$title.""; } } return $return_values; } function generate() { $feed = new Feed(); $channel = new Channel(); $channel ->title("Dilbert") ->description("Dilbert - with Pictures") ->url( "https://feeds.iamfabulous.de/Dilbert.xml" ) ->pubDate(strtotime(date("r", time()))) ->lastBuildDate(strtotime(date("r", time()))) ->ttl(5) ->appendTo($feed); #->url("http://feeds.iamfabulous.de/".$name) $r = get_dilbert_items(); foreach($r as $item) { $item_out = new Item(); $item_out ->title($item["title"]) ->description($item["description"]) ->url($item["link"]) ->pubDate(strtotime(date($item["time"]))) ->appendTo($channel); } if ( ! file_exists( PUBLIC_DIR ) ) { mkdir( PUBLIC_DIR ); } file_put_contents(PUBLIC_DIR . '/Dilbert.xml', $feed ); } generate();