Parsing Google News RSS with PHP

后端 未结 3 795
逝去的感伤
逝去的感伤 2020-12-16 07:56

I want to parse Google News rss with PHP. I managed to run this code:



        
3条回答
  •  既然无缘
    2020-12-16 08:30

    1. To get the URL for a news item, use $item->link.
    2. If there's a common delimiter for the related news links, you could use regex to cut off everything after it.
    3. Google puts the thumbnail image HTML code inside the description field of the feed. You could regex out everything between the open and close brackets for the image declaration to get the HTML for it.

提交回复
热议问题