Quantcast
Channel: Extracting Channel Data from fetch_feed() - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 2

Extracting Channel Data from fetch_feed()

$
0
0

How do I access the channel data when using fetch_feed()? I want to use the channel title.

TIA

Further info:

A typical RSS feed (taken from wikipedia)

<?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.example.com/main.html</link><copyright>2020 Example.com All rights reserved</copyright><lastBuildDate>Mon, 6 September 2010 00:01:00 +0000</lastBuildDate><pubDate>Sun, 6 September 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.example.com/blog/post/1</link><guid isPermaLink="false">7bd204c6-1655-4c27-aeee-53f933c5395f</guid><pubDate>Sun, 6 September 2009 16:20:00 +0000</pubDate></item></channel></rss>

I wish to extract and use the channel title instead of the item title (because the mastodon feed doesn't use them currently).

I can access the data in <item> but accessing parts of <channel> I can't work out.

Does that help?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images