[development] Programmatic data importing from JSON source

David Metzler metzlerd at metzlerd.com
Sun Feb 15 16:35:06 UTC 2009


Hey Paul,

I haven't done this with JSON, but have written some XML to nested  
array conversion stuff that might help, but might not. Could you  
shoot an example of the feed and what makes it so complicated so that  
we don't shower you with irrelavent solutions :).  Is it that you're  
trying to parse data that's inside XML that makes it so nasty or  
something else?

You give me the impression that the JSON feed contains more  
information than the other feed.  Is that true?

Dave
On Feb 15, 2009, at 6: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
>



More information about the development mailing list