2

This is something I have had no experience with whatsoever, so I am hoping that someone can tell me whether it is possible or not.

I have a site up and running, and I am looking at starting a section for people to find holiday properties.

The information of these properties can be accessed via an XML feed of the details and a separate csv of the prices and photos.

The data is presented like so in the XML..

<tcreated>2013-04-09 22:30:26</tcreated>
<cweblink>http://www.linhere</cweblink>
<nid>55</nid>
<nremoteid>0</nremoteid>
<tupdated>2013-04-09</tupdated>
<cpropname>Brazengate Family Cottage, Long Ashes, Threshfield, Yorkshire Dales (Ref 55)</cpropname>
<ccountry>England</ccountry>
<carea>Yorkshire Dales</carea>
<csubarea>Yorkshire Dales - Wharfedale</csubarea>
<short_name>Brazengate</short_name>
<cvillagename>LONG ASHES, THRESHFIELD</cvillagename>
<nlatitude>54.0789359001</nlatitude>
<nlongitude>-2.0351578974</nlongitude>
<cpriceinfo>All prices are inclusive of the booking fee.&lt;BR&gt;&lt;BR&gt;Winter Short Breaks (WSB) are available at many properties in the "Winter" period - subject to availability. Extra nights are charged pro rata of the weekly rental.&lt;BR&gt;&lt;BR&gt;Off Season Breaks (OSB) are available at many properties in parts of the "Low" and "Mid" periods - subject to availability. The price for a 3 night break is either 75% of the normal weekly rental or, if it is higher, the quoted Winter Short Break price. Extra nights are charged pro rata of the weekly rental. OSBs can be booked within a calendar month of the start date of the holiday.&lt;BR&gt;&lt;BR&gt;"Last Minute Breaks" (LMB) are available at most properties throughout the "LOW", "MID", "HIGH", "PEAK", "XMAS" and "NEW YEAR" periods. The price for a 3 night break is either 65% of the normal weekly rental or, if it is higher, the quoted Winter Short Break price. Extra nights are charged pro rata of the weekly rental. LMBs can be booked within one week of the start date of the holiday. </cpriceinfo>
<nminprice>310</nminprice>
<nmaxprice>575</nmaxprice>
<nbedrooms>2</nbedrooms>
<lkettle>1</lkettle>
<lparkingspace>1</lparkingspace>
<lsmoking>0</lsmoking>
<nsinglebeds>0</nsinglebeds>
<ndoublebeds>1</ndoublebeds>
<ntwinbeds>1</ntwinbeds>
<nbunkbeds>0</nbunkbeds>
<nfamilybeds>0</nfamilybeds>
<nmaxsleeps>4</nmaxsleeps>
<cproppostcode>BD23 5PN</cproppostcode>
</cottage>

Now I've seen that there is an add-on called Datagrab, and I am assuming this will be handle this kind of import?

I can see how I can map most of those fields, so that shouldn't be a problem. Where I am a bit unsure is that the images for each entry are stored as urls in a separate csv feed that looks like this...

nid,cURL,tUpdated,nPosition
10006,http://sc_13279413350143_10006_01.jpg,2012-01-30,2

Now will it be possible to pull those images in the entries that are created via the initial XML import? It would need to match the "nid" custom field (I create) to hold the "nid" value from the XML and match it with the "nid" in the csv image import. Also it would need to order them as per the nPosition value.

I'm hoping this is possible, because there's around 2000 entries that need to be created, and I really do not fancy doing so by hand!

Thanks!

1

Yes, you just run your initial import to get your properties entries into the system, storing the nid as a custom field.

Then run a second import with the option to update existing entries using nid to map the image data to the correct existing entry.

Datagrab will work and is a great add-on. Solspace Importer is also very nice.

  • That sounds good. Just been reading the docs some more and have come across the recommendation to specify a unique id in a custom field. Luckily as both set of data contain the same unique id, this should be achievable. I also have a requirement where I only need certain entries to be imported. E.g. ones where the value of <lsmoking>0</lsmoking> equals 1. But I'm not sure that is do-able? – shorn Apr 10 '13 at 19:32
  • I'm not immediately seeing an option in either Datagrab or Importer to skip records based on the content of a field but that doesn't mean there isn't a way. An alternative approach would be to groom your import source (the CSV) prior to import. – Alex Kendrick Apr 10 '13 at 19:59
  • Thats true, although the main bulk of the data comes from the XML, and I'm not sure how to edit that XML to delete an entry based on a field? Will have to think of the best way to do it! Theres about 4000 entries in total and I only require half, so seems a bit redundant to import everything! – shorn Apr 10 '13 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.