Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 15-03-06
Registered User
 
Join Date: Aug 2003
Posts: 218
Thanks: 1
Thanked 0 Times in 0 Posts
Andy is an unknown quantity at this point
  Dixons own brand XML Feed

Dixons own datafeed has the following format:

<RECORD ID = "391041">
<FIELD NAME = "STORE" VALUE = "103"/>
<FIELD NAME = "AFFILIATE" VALUE = "Dixons - UsefulInfo"/>
<FIELD NAME = "PRODUCT ID" VALUE = "391041"/>
<FIELD NAME = "CATEGORY PATH" VALUE = "Phones &amp; Faxes&gt;Phones&gt;Telephones Cordless Digital"/>
<FIELD NAME = "LEAF CATEGORY" VALUE = "Telephones Cordless Digital"/>
<FIELD NAME = "NAME" VALUE = "BRIT TELE FS7310"/>
<FIELD NAME = "LONG DESCRIPTION" VALUE = "DIGITAL CORDLESS TELEPHONE"/>
<FIELD NAME = "SHORT DESCRIPTION" VALUE = ""/>
<FIELD NAME = "PRICE" VALUE = "69.99"/>
<FIELD NAME = "MINIMUM DELIVERY PRICE" VALUE = "6.99"/>
<FIELD NAME = "LIST PRICE" VALUE = "69.99"/>
<FIELD NAME = "WAS PRICE" VALUE = "79.99"/>
<FIELD NAME = "WAS WAS PRICE" VALUE = ""/>
<FIELD NAME = "PRICE_TYPE" VALUE = "Standard Price"/>
<FIELD NAME = "WEB_SPECIAL_DATE" VALUE = ""/>
<FIELD NAME = "STANDARD_PRICE_DATE" VALUE = ""/>
<FIELD NAME = "PROD SOURCE" VALUE = "NDC"/>
<FIELD NAME = "PROD SOURCE OVERRIDE" VALUE = ""/>
<FIELD NAME = "SALT OVERRIDE" VALUE = "1"/>
<FIELD NAME = "STOCK AVAILABILITY" VALUE = "In Stock"/>
<FIELD NAME = "REAL PROD SOURCE" VALUE = "NDC"/>
<FIELD NAME = "PROD SOURCE OVER RIDE" VALUE = ""/>
<FIELD NAME = "PROD CLASS" VALUE = "Standalone"/>
<FIELD NAME = "MANUFACTURER PART NO" VALUE = "019808"/>
<FIELD NAME = "PRODUCT TYPE" VALUE = "Digital Cordless Telephone"/>
<FIELD NAME = "BRAND" VALUE = "BT"/>
<FIELD NAME = "MODEL" VALUE = "FREESTYLE 7310"/>
<FIELD NAME = "TYPE INFORMATION" VALUE = "DIGITAL CORDLESS TELEPHONE"/>
<FIELD NAME = "DELIVERY STATEMENT" VALUE = "Delivery 4-5 days"/>
<FIELD NAME = "FEATURE TXT 1" VALUE = "200 Name &amp; Number Memory"/>
<FIELD NAME = "FEATURE TXT 2" VALUE = "SMS Text Messaging"/>
<FIELD NAME = "FEATURE TXT 3" VALUE = "Single Pack"/>
<FIELD NAME = "FEATURE TXT 4" VALUE = "30 hours Battery Standby"/>
<FIELD NAME = "FEATURE TXT 5" VALUE = "10 hours Battery Talktime"/>
<FIELD NAME = "FEATURE TXT 6" VALUE = "300 m Range (up to)"/>
<FIELD NAME = "FEATURE TXT 7" VALUE = "Up to 6 Handsets"/>
<FIELD NAME = "FEATURE TXT 8" VALUE = "Silver Colour"/>
<FIELD NAME = "FEATURE TXT 9" VALUE = "GAP Compatible"/>
<FIELD NAME = "FEATURE TXT 10" VALUE = "1 Handset Supplied"/>
<FIELD NAME = "IMAGE URL" VALUE = "http://www.dixons.co.uk/images/391041_01_small.jpg"/>
<FIELD NAME = "IMAGE URL LARGE" VALUE = "http://www.dixons.co.uk/images/391041_01_large.jpg"/>
<FIELD NAME = "LINK URL" VALUE = "http://www.dixons.co.uk/product.php?sku=391041"/>
<FIELD NAME = "TRACKING CODE PRE URL" VALUE = ""/>
<FIELD NAME = "TRACKING CODE POST URL" VALUE = ""/>
</RECORD>

I haven't managed to write the code in PHP neccessary to parse this as I am used to XML feeds having unique tags for each data type.

Can anyone show me how you can extract name and value data from each field tag?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 15-03-06
scifind's Avatar
thin[box]king
 
Join Date: Aug 2003
Location: Cambridge
Posts: 1,844
Thanks: 8
Thanked 4 Times in 4 Posts
scifind is an unknown quantity at this point
Where did you get this feed from?
__________________
Earn an average of £45 per sale. | New Star Trek Trailer | Looking for Mobile Phone Link Swaps
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 15-03-06
Registered User
 
Join Date: Aug 2003
Posts: 218
Thanks: 1
Thanked 0 Times in 0 Posts
Andy is an unknown quantity at this point
Quote:
Originally Posted by scifind
Where did you get this feed from?

Dixons Group of course. I can PM u a contact name if you wish. But do you know how to parse such an XML feed?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 15-03-06
Registered User
 
Join Date: Mar 2004
Location: Reading, UK
Posts: 301
Thanks: 0
Thanked 0 Times in 0 Posts
dmorison is an unknown quantity at this point
Here's a quick attempt "off the top of my head" and assuming that the file is called "dixons.xml" in the same directory as the script. Might not work straight away but should be close...

PHP Code:
<?php
  
function xml_start_tag($parser,$name,$attribs)
  {
    global 
$record;  
    if (
$name == "RECORD")
    {
      
$record = array();
      return;
    }
    
$record[$attribs["NAME"]] = $attribs["VALUE"];
  }
  function 
xml_end_tag($parser,$name)
  {
    global 
$record;
    if (
$name == "RECORD")
    {
      
// use $record here
      
print_r($record);
    }
  }

  
$parser xml_parser_create();

  
xml_set_element_handler($parser"xml_start_tag""xml_end_tag");

  
$xml fopen("dixons.xml","r");

  while(!
feof($xml)) xml_parse($parser,fread($xml,1024) ,false);

  
xml_parse($parser,"",true);

  
fclose($xml);
?>
What this does is use PHP's internal Sablotron (event based) parser to call the function xml_start_tag for every tag in the source document.

If that tag is "RECORD", it starts a new $record array. Otherwise, it creates an entry in the $record array with the key name from the attribute "NAME" and the value from the attribute "VALUE".

The xml_end_tag function is called every time the parser encounters a tag closing, so you check that to see if it is "RECORD", and if so, you can use the contents from the $record array.

Hope this works.... (might have a few bugs)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 15-03-06
Registered User
 
Join Date: Aug 2003
Posts: 218
Thanks: 1
Thanked 0 Times in 0 Posts
Andy is an unknown quantity at this point
Thanks Dmorison. I'll play around with this code and see if I can sort it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 15-03-06
Registered User
 
Join Date: Aug 2003
Posts: 218
Thanks: 1
Thanked 0 Times in 0 Posts
Andy is an unknown quantity at this point
Yes it is now parsed. Thanks a lot Dmorison. I owe you one. Just got to extract the fields I want now but should manage that on my own.

Thanks again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Good Feed Guide (For Merchants) clint45 Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 13 17-11-05 09:30 PM
affiliate feed middleware pricethat The Affiliate Marketing Lounge 19 04-02-05 11:17 AM
PC WOrld / Dixons Product Feed hells TradeDoubler 0 13-01-05 03:13 PM
Dixons Feed - Needs Manufacturers madeinbritain Commission Junction - CJ UK 0 19-06-04 12:08 PM
Dixons Feed - product names problem again madeinbritain TradeDoubler 0 11-06-04 01:22 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7