[development] Programmatic data importing from JSON source

Richard Morse remorse at partners.org
Tue Feb 17 15:34:27 UTC 2009

Hi! I have written a module using XMLRPC to import data to a CCK- 
defined node type. I imagine that it wouldn't be too hard to modify to  
match your requirements. If you're interested, send me an email...


On Feb 15, 2009, at 9:33 AM, Paul Hoza wrote:

> Hello folks,
> I've been struggling for a long time (way too long) to get a data  
> feed imported into CCK nodes.  I've attempted a plethora of  
> different strategies, including but not limited to:  FeedAPI, Feed  
> Element Mapper, custom parsers, hacking parsers, tweaking mappers,  
> Yahoo! Pipes to create custom feed versions of the original feed,  
> serialized PHP exports, etc.
> I'm tired of the project, but I have to find a way to get this to  
> work.
> So, I found a few articles on programmatically creating CCK nodes  
> and I'm hoping to connect with anyone who's had experience doing  
> this with JSON data.  There is an XML/RSS version of this feed I  
> need, but it sucks compared to the JSON version, with respect to how  
> much data is in there and how it's formatted.  The XML version hides  
> a lot of crucial info into a <summary> element... which I might be  
> able to parse through separately, but RSS feed aggregators just  
> ignore stuff in there.  Again, I'd have to make a custom parser to  
> get in there.
> Here's an article that hits about as close as I've seen yet.  I am  
> leaving for a couple days, so I'll try to get something like this  
> working when I get back, but I hoped to hear from anyone who's done  
> the same thing.  Information on using JSON data to create nodes is  
> sparse, but this article hits pretty close to the mark:
> https://secure.prolucid.com/node/43
> I had read other posts about doing similar methods using  
> drupal_execute(), et. al, but they all talk only about XML as data  
> source.  I haven't found anything talking about JSON or  
> (un)serialized PHP sources.
> What I really need to do is do an initial import of the JSON feed  
> into my CCK node (which is a huge feed of 6,200+ items).  After  
> that, I want to check the feed every day for changes and create new  
> daily nodes accordingly -- which is why FeedAPI really seemed like  
> the ticket, aside from my massive struggles with making my own  
> parser.  For now, I'd be happy with a PHP script that I could call  
> daily with cron.
> Thanks for any feedback... sorry for the long post.  Part rant, part  
> plea.  :)
> Cheers,
> Paul Hoza

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

More information about the development mailing list