Search code examples
phpfeedsimplepie

extract complete content of websites via feed in php


i want get complete content of a news or post of a website via feed. but we know that many websites only presents some part of news or post via their feed.
of course i know that exists a script called SimplePie that is developed for get content of websites via feed. but this script do not retrieve full content of a news.
of course i found a script called Full-Text Feeds that do It. but it is no free . i want a free script.
Do you know a similar script or way to do my need?


Solution

  • The code behind Five Filters' content extraction is actually open source, and is based on Readability's original Javascript (before they became a service).

    You should be able to use it like this:

    $page = file_get_contents($item_url);
    $readability = new Readability($page);
    if ($result = $readability->init()) {
        $content = $readability->getContent()->innerHTML;
    }