I use some RSS feeds. Some of them don't have a description for their articles.
In order not to show just the title and no description for those articles, I would like to show for example the first two paragraphs of the actual article.
I experimented with stripos
, file_get_contents
but I have a problem. In most pages it works fine, but in other pages it grabs the first <p>
tag (which can be for example a paragraph in the sidebar) and is irrelevant to the article that is mentioned in the RSS feed.
Any idea about how to grab the main content from a URL strictly in PHP or JavaScript?
Thanks in advance.