Page 1 of 1

Modifying feeds plugin based on af_redditimgur

Posted: 19 Feb 2015, 16:54
by wonko69
Hi,

I'm trying to modify the plugin fox made called af_redditimgur.

I want the plugin to replace the [link] in reddit feeds with the URL. The problem I have run into is how to only identify the [link] and not all a tags in the post. I have tried using the $entry->getAttribute("text") and $entry->firstChild but none of them return any value.

Any ideas on how to identify the [link] anchor? Cheers

and thanks for a superb program Fox.

Re: Modifying feeds plugin based on af_redditimgur

Posted: 19 Feb 2015, 18:28
by JustAMacUser
I don't use this so I have no idea how the page is structured, but if you want the text in a tag that's a text node and accessible with the text() option in XPath. If you have the domnode object I think you can just do $entry->nodeValue.

Re: Modifying feeds plugin based on af_redditimgur

Posted: 19 Feb 2015, 19:58
by wonko69
Cheers JustAMacUser. I got it working by googling a little more and looking at a link I had skipped earlier when I was coding.

The magic sauce was $entry->textContent

Re: Modifying feeds plugin based on af_redditimgur

Posted: 11 Jul 2016, 19:54
by malmsey
Apologies for the necrobump, but could you share your modifications? I was looking for something just like this, and this post was all that I could find.