You're on the right track! But it all depends on the format that the RSS Feed is set up in.
The item
node actually contains a whole bunch of different fields, of which link
is only one. Take a look here for information on the other fields that the item
node contains.
Now, if the RSS feed points directly to the image file, then you can just use item->link
. More likely, however, the link points to a blog post or something that has the image embedded in it. In this case, you can undertake some processing on $feed->channel->item->description
to find what you need. The description
node contains an escaped HTML summary of the post, and then from there, you can just use a regular expression to find the source of the image. Also remember: before you start using the regular expressions, you might need to decode the description
using htmlspecialchars_decode()
before you start processing it with the regular expressions - in my own experience, descriptions often come formatted with special characters escaped.
I know that's a lot of information, but once you get started it's really not as hard as it sounds. Good luck!