Closed (fixed)
Project:
Feeds Self Node Processor
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2011 at 19:45 UTC
Updated:
17 Oct 2014 at 05:54 UTC
Jump to comment: Most recent
Comments
Comment #1
mitchell commentedYes, you're definitely on the right track. Getting the full contents of an RSS feed was one of the intended uses for XPath Parser. You'll see in a moment though; there's a small bit of functionality not included in Feeds or XPath Parser that can help accomplish this in a very clean manner.
First off, a basic principle when scraping remote content in Drupal is that the content will be presented as either a list or a record (todo: create a scraping glossary), and one feed will not work for both. The feed that imports the list of items (in this case an RSS feed, instead of a page scraper) will create a bunch of feed items but will not be useful for scraping the rest of the content. So, in most cases, the feed items will be incomplete.
The next feed needs to be configured specifically to import an individual record. It uses the imported source url or a user defined url to fetch the rest of the content. In a standard feeds configuration, a feed importer is separate from the item(s) that it creates. In this case however, one feed to import one other node would result in cumbersome duplication. Alternatively, with Feeds SelfNode Processor, individual records can imported with a feed importer that updates itself. This is sole purpose of the module.
I'll try to walkthrough the process using helpful names, but you can obviously change them to whatever it is you want:
1. Create the content types 'RISMedia Feed' for the attached list feed and 'RIS Media Article' for the articles.
2. Setup the feed that import lists of articles, 'RISMedia RSS'.
3. Create another feed, 'RIS Media Article Unteaser'.
General note: you can chain several list feeds and combine multiple single item processors. This would more so resemble a spidering scraper.
Comment #2
mitchell commentedComment #3
dion6898 commented'opensanta', let me first reply by mentioning that I've never had as detailed response/explanation as that one with regards to issues I've posted in the past...THANK YOU. Now, after following your instructions, I setup everything as directed, however, after importing for the 1st time, I was greeted with a host of errors, which I've listed below:
Now I will say that, it does actually import items, however, only the title and Item URL (I'm assuming, b/c I can't actually see it), are coming thru. I would imagine this is solely due to the 'RISMedia RSS' importer working as it should. I'm pretty confident it has nothing to do with the actual XPath query, b/c I was able to generate a working one with the use of a sweet little Firefox add-in called XPather, that does the dirty work for you. I'm assuming it's having something to do with the "Unteaser" importer appending the article content to the existing article node already created. Also, I was wondering, how does the "Unteaser" importer know that the XPath query need be run to scrape the actual article to be appended, based on the Item URL link mapped for for the created nodes originally by the 'RISMedia RSS' importer? Any insight?
UPDATE: I made a couple tweaks, however, I'm still receiving the warning messages, minus the "download failed" error. I really think the article content not being appended to the already existing node has to do with my 'RISMedia Article Unteaser' importer not being supplied with a URL mapping so that the XPath scraper/query can do it's business. I say this b/c whenever I do go in to edit one of the individual imported item-generated nodes (say the 5 times fast, lol), I see a blank URL field, similar to the field I originally populated with the address of the RSS source, when I created the 'RISMedia Feed'. If I'm correct, I don't/wouldn't know how to supply/map that URL, b/c the 'RISMedia Article Unteaser' importer is setup to only take in XPath mappings, in order to scrape the article content from the "supplied" URL, which is mapped in via the 'RISMedia RSS' importer. So what do the warnings above mean, and how (if necessary) do I supply each unique feed item/node ('RISMedia Article') with the URL link to the actual article?
Comment #4
dion6898 commentedComment #5
dion6898 commentedComment #6
noleafclover commentedI have the same issue and error messages as dion6898 but content is also failing to update after the first import.
Any suggestions?
Comment #7
dion6898 commentedHey noleafclover, while we hopefully await an answer to our issues, checkout http://drupal.org/node/1070746. I posed the same question, and got a workaround solution in the meantime. Actually, I like it alot better than my initial plan. Here's a link to my Pipe™ if you decide to go that route http://pipes.yahoo.com/pipes/pipe.info?_id=0dacac88253f75da72cae69552204c22. Hope that helps a little.
Comment #8
kapayne commentedThanks very much for the guidence on this open santa. For some reason, after installing feeds self node processor 6.x-1.x-dev I don't get the option for a 'SelfNode Processor, XPath HTML'. I set up the first importer and attach it to the feed ('RISMedia Feed') and when I set up the second feed importer I attach it to the content item ('RIS Media Article') but the only options for processors I have are the node processor and the feed node processor - both of which have xml parsers which is great - but the second importer requires me to select another content type which doesn't make sense as I want it to update itself. Is there something obvious that I'm missing? thanks!
Comment #9
kapayne commentedMy apologies. User too stupid. CTFC. I failed to clear the cache. Now I have the Self node processor.
Comment #10
kapayne commentedI'm having the same problem - it creates nodes witht he title and body only, but no other xpath defined field values so it doesn't appear the the 'self node processor' is reaching into the full xml beyond the feed list. I know the xpaths are correct because I uploaded a sample of the full xml as a stand alone file and it populated the drupal fields correctly.
Comment #11
mitchell commentedI'm sorry I haven't had time to contribute toward documenting this module. I'm working on some similar but very different data processing contributions.
To those commenting and working on this, thank you and godspeed. When the understanding emerges, please start fleshing out the handbook for this module.
I'll make at least a couple of further comments about my experiences with this module:
- I had similar issues when trying to set it up.
- There have been small quirks in each version. As kapayne pointed out, it was/is necessary to clear the cache after installation. Another one that hasn't been mentioned mentioned is to hit the submit button on a blank form in the processor settings page before adding the mappings (something to that effect, but I'm not sure where this was done or if twistor fixed this in a later release).
- Once I got it up, I released Example Web Scraper to try to help people around configuring these modules. That is only a workaround though; it would be helpful for many users to have the solution to this issue compiled into a handbook.
Thank you.
Comment #12
demonrage commented@mitchell the walkthrough you have mentioned doesn't work and it result in too many errors, is there any other method that pull the full content out of rss feeds ?, plus the way u mentioned need a new feed item for every site we need to grab, because every site has its own classes and id's and of course xpath identifiers.
Comment #13
tecjam commentedI got exactly as far as #3, but I don't get any error messages.
The nodes are created, but as the update in #3 explains, the url of the article to scrape is not mapped, as when i edit a RISMedia Article node, the url to to article is blank!!
If I manually add the correct url into the feed field it gets the content correctly.
Can someone explain what is needed to be able to do this?
Comment #14
Robin Millette commentedIf someone is kind enough to publish an rss feed, shouldn't they get to decide what they want to share? Couldn't you for instance contact the source and ask that they provide full content, or explain why they don't? If they publish under a "free spirit" licence such as one of the Creative Commons, it shouldn't be too hard to convince to publish the content as a whole in their feeds, no? And if not, well... It's not because something is public that it is free to do whatever you like with it (come fair use provisions).
Just my 0.02$ on this topic.
Comment #15
Michsk commentedI'm stuck with exactly the same issue. The self node items are not running. Here are my two exports, list and article:
List
Article
My list is a standalone form, so not attached to a node.
Comment #16
Michsk commentedOk, everything seems to be working. Had some strange queue and cron issues but those seem resolved and now everything is working.
Comment #17
hurdygurdy commentedLasac, can you elaborate on your queue and cron issues and how you fixed them? Looks like I have the same problem as you.
Comment #18
Michsk commentedI dumped all the feeds node queues in the queue table, run cron couple of times and it started working as expected. Guess you could use the job queue module as well to run trough the queue.
Comment #19
Michsk commentedOk. Seems that the selfnode must contain data to import or else it's not working as expected. I have not digged deeper but for me, the body i tried to import seemd to be empty.
Comment #20
tinohuda commentedSame issue here, the body is empty then I click import from the node "Article" (#15) in the tab menu and click import button, so the body field being populated with xpath parser results.
Any idea how to queue per node "Article" import ?
Comment #21
tinohuda commentedhmm... all i need is just running cron for several time or wait until the cron job running to import selfnode (populated body field). now my setup working. But, there's another problem, every time cron job running all of the feed importer and article process to be update. So the cron queue increase significanly.
how can we stop article being updated for second and later times?
anyone has a clue?
Comment #22
twistor commentedThe fact that selfnode_processor feeds are scheduled when update_existing = skip is silly and we should fix that.
#2349349: Unschedule feed when update_existing is skip.