Generate RSS

    Everyone knows about RSS and how to read and even parse it , but how to convert an article from a html code to a valid RSS for a web developer can be problematic. The presence of <,>, & characters can be typical problems. In addition, difficulties with the presence of object tags inside the description lead to the fact that it is impossible to make a video object in rss. Try FeedCreator . Hulk, supports all kinds of ATOM, RSS 0.9-RSS 2.0, OPML, MBOX. You must manually change the encoding to UTF8, the object wants to immediately create an xml file. Well, this is reasonable in principle, one-hour caching is not critical for a blog, you need to reduce it to a couple of minutes for news sites. The validator still swears on flash (therefore, object is not supported). In addition, relative paths are not liked. Of course you can change$rss = new UniversalFeedCreator();
    $rss->useCached();
    $rss->title = "Artjom Kurapov";
    $rss->description = "Personal Blog";
    $rss->link = "http://kurapov.name/";
    WYSIWYG so that it immediately generates absolute paths, but if you need to change the domain, you will have to work a lot with the database. Therefore, we generate them together with RSS. And as a result
    $recEntry->description=preg_replace("//i",'',$recEntry->description);
    $recEntry->description=str_replace("href='/","href='http://kurapov.name/",$recEntry->description);
    $recEntry->description=str_replace('href="/','href="http://kurapov.name/',$recEntry->description);
    $recEntry->date = date('r',$item->unix_added);
    $rss->addItem($recEntry);
    echo $rss->saveFeed("RSS2.0", "feed.xml");



    [Valid RSS]

    Also popular now: