PHP Scanner RSS Feed

I want to create an RSS feed scanner for my site. Although I'm not quite sure how to start this. How does my crawler identify the RSS feed? Is there anything I can crawl that every RSS reader has? I don't need any code, just help my brain understand what I have to create.

Thanks before!

Hi

Xatenev

+4
source share
1 answer

I think it would be possible if your crawler crawls all the links and opens each page at least once to find the text <rss version="2.0">. As far as I understand, each RSS feed should contain this line.

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
 <title>RSS Title</title>
 <description>This is an example of an RSS feed</description>
 <link>http://www.someexamplerssdomain.com/main.html</link>
 <lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate>
 <pubDate>Mon, 06 Sep 2009 16:20:00 +0000 </pubDate>
 <ttl>1800</ttl>

 <item>
  <title>Example entry</title>
  <description>Here is some text containing an interesting description.</description>
  <link>http://www.wikipedia.org/</link>
  <guid>unique string per item</guid>
  <pubDate>Mon, 06 Sep 2009 16:20:00 +0000 </pubDate>
 </item>

</channel>
</rss>

PHP, SimpleXML, PHP.

P.S. Xatenev, ;)

+2

Source: https://habr.com/ru/post/1535930/


All Articles