Modifying feeds plugin based on af_redditimgur

Development-related discussion, including bundled plugins
wonko69
Bear Rating Trainee
Bear Rating Trainee
Posts: 7
Joined: 19 Feb 2015, 16:49

Modifying feeds plugin based on af_redditimgur

Postby wonko69 » 19 Feb 2015, 16:54

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.

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Modifying feeds plugin based on af_redditimgur

Postby JustAMacUser » 19 Feb 2015, 18:28

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.

wonko69
Bear Rating Trainee
Bear Rating Trainee
Posts: 7
Joined: 19 Feb 2015, 16:49

Re: Modifying feeds plugin based on af_redditimgur

Postby wonko69 » 19 Feb 2015, 19:58

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

malmsey
Bear Rating Trainee
Bear Rating Trainee
Posts: 1
Joined: 11 Jul 2016, 19:21

Re: Modifying feeds plugin based on af_redditimgur

Postby malmsey » 11 Jul 2016, 19:54

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.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 7 guests