If I use the Feeds RSS parser I am able to use http://drupal.org/project/feeds_imagegrabber to download images from the RSS Description field. Hover if I switch to Feeds XPath XML Parser - which I need in order to download files in enclosures - Feeds IMage Grabber no longer downloads images from the Body field.

The error message I get back is

Invalid enclosure http://example.com/sites/default/files/images/donate.png

However http://example.com/sites/default/files/images/donate.png is the correct address for the original image.

Does anyone know why XPath XML Parser may be interfering with feeds_imagegrabber?

thank you.

Comments

daglees’s picture

What source field are you mapping to FIG?

dawnbuie’s picture

Hi @Daglees, I'm using the absolute source url of the blog item on the originating page. Just as I had with the RSS parser.

I do think I got some items to download (although I'll have to re-check that in an experiment today) at one point - but they weren't associated with the new node.

I have looked at the module code for FIG - and I don't see the error message "Invalid enclosure" so I suspect that comes from the Feeds XPath Parser module.

I wonder if there is something that needs to be called in FIG to help it save a node with the newly downloaded images when using XPath Parser?

Has anyone successfully used FIG and XPath Parser before?

helpmelearn’s picture

no man its not working.. , any one knows how to fix this ?

daglees’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev
StatusFileSize
new744 bytes

I'm using this code to grab the source URL so that I can map that with FIG.

twistor’s picture

Status: Active » Needs work

That patch is backwards.

summit’s picture

Are you saying what "minus" is must be "plus?
Greetings, Martijn

twistor’s picture

Yessir.

summit’s picture

@Daglees please post the patch as should be, would love seeing both modules working together.
greetings, Martijn

daglees’s picture

StatusFileSize
new1.06 KB

Updated patch.

daglees’s picture

StatusFileSize
new1.06 KB

Updated patch.

// Double post, sorry!

daglees’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, item_url_fwd.patch, failed testing.

Anonymous’s picture

Issue summary: View changes

clarification

rooby’s picture

The problem with the patch is that it won't apply properly.

This is because of this: /Users/daglees/Sites/yakhabar/sites/all/modules/feeds_xpathparser/FeedsXPathParserBase.inc

This means that if you put it in the module directory and apply it with the patch command you would have to use "patch -p7", but it is expected to apply with "patch -p1" (this is the number of directories before the module directory).

See https://drupal.org/node/707484 for some further information.

rooby’s picture

Issue summary: View changes

Changed sitename.com to example.com, which is what should always be used.

kscheirer’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new938 bytes

Here's a p1 version of the patch, also updated against latest 7.x-1.x-dev.

The patch worked for me. My feed uses HTTP Fetcher, XPath HTML Parser, and Self Node Processor.

After applying the patch, in the Mappings section of my processor, I set the source to "Item URL (Link)" and the target to "My Image (FIG)". On the next import it successfully found the image and saved it locally with the node. I assume the default settings for FIG were used to figure out which image to grab.

Status: Needs review » Needs work

The last submitted patch, 14: 1874026-item_url_fwd-14.patch, failed testing.

kscheirer’s picture

Status: Needs work » Needs review
StatusFileSize
new930 bytes

This is a much better patch - it only adds the url when the result is not empty.

Not sure why, but parse() can get called multiple times, with only 1 generating a real result. Adding url blindly creates too many items, and then everything starts breaking.

Status: Needs review » Needs work

The last submitted patch, 16: 1874026-item_url_fwd-16.patch, failed testing.

kscheirer’s picture

I think it's a problem with the test, the failures are:
Text "Updated 1 node." not found

Mario Baron’s picture

the patch from #16 is progress. However, on import only one image is added.
My feed uses HTTP Fetcher, XPath HTML Parser, and Node Processor. Using standalone form because I can't attach node processor to content type (bundle) because in that case the feed doesn't work (can't find title)

twistor’s picture

Title: Feed Images Grabber doesn't work with Feeds XPath XML Parser » Add feed URL as mapping source.
Project: Feeds XPath Parser » Feeds
Category: Bug report » Feature request
Issue tags: +Needs tests

This should just go in Feeds. It's not Feeds XPath Parser's responsibility to do this.

kscheirer’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs work » Needs review
rooby’s picture

Status: Needs review » Needs work

This patch will not apply to feeds as it was written for feeds xpath parser.

A new patch will need to be made for the feeds module.

twistor’s picture

Status: Needs work » Closed (duplicate)

This is already being worked on here #1689374: Map feed Title and feed URL