1

I am trying to display feeds from a couple of my blogs using the build in function fetch_feed() however I stumbled across a few problems.

I am storing the rss urls in the links section and will be calling the link_rss as the input for fetch_feed(). I know that I would have to deal with an array, perhaps nested arrays??

Can someone be kind enough to give me a way of pulling all the link_rss fields into one single variable which can be use for fetch_feed()??

Having the variable in the form of an array would be great so I can just plug it in to the function like so fetch_feed($variable).

Any help would be greatly appreciated. Thanks!!

2 Answers 2

1

Possible, only I am not entirely sure about specifics of looping through multi-feed SimplePie object. Customize get_bookmarks() call to query for links you need.

$bookmarks = get_bookmarks(); $feeds = array(); foreach($bookmarks as $bookmark) if($bookmark->link_rss) $feeds[] = $bookmark->link_rss; $items = fetch_feed($feeds); 
0

Short answer: No.

fetch_feed() expects an URL, so you basically need to create a URL that will return link_rss data in form of RSS-Feed while being requested via HTTP. That looks too complicated in my eyes.

Filtering the fetch_feed() function is too complicated as well. Probably injecting the feed using the data: url scheme might do some magic, but I assume that SimplePie might not deal with that.

4
  • Nope, fetch_feed() uses SimplePie->set_feed_url() that accepts mixed input of single URL or array of URLs. Commented Jan 25, 2011 at 7:14
  • @Rarst: You see some chance to make use of that for something usefull? I did understand the asker that he wants to have a feed consisting of his links and not the feeds on his links. Commented Jan 25, 2011 at 16:24
  • ehm, I interpreted question as how to produce combined feed of several sources. I don't see anything about producing feed in question, only about fetching?.. Commented Jan 25, 2011 at 16:35
  • @rarst: well then, you answer should be doing the job. I might just got the question wrong. Commented Jan 25, 2011 at 18:08

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.