Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 25-02-06
Registered User
 
Join Date: Dec 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
CALLOW is an unknown quantity at this point
  Lightbulb Looking for Code which can Parse Product Feed

Hi everybody,
i am running mobile affiliate site & like most of the affiliates i am facing the same problem i.e updating feeds
it keeps on changing on daily basis & the format in which it is provided is not compatible with our database so that i can upload it directly in my database
i have even asked them i.e my merchants to provide feeds according to the format i need & its almost resolved now but still i need some code which can parse the whole feed if anybody can help me in sorting out this problem then feel free to reply.
like i want to parse particular 1 coloumn which is something like that
Sony Eric. K750i for 0.00 when you connect to Orange Your Plan 120 .With this offer you get 6 months at £4.99
& i want this to be parsed out
like handset name, plan name, offer, rental everything in seperate coloumn

Cheers
Jack
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 25-02-06
drivetowin's Avatar
Driving to win
 
Join Date: Aug 2003
Location: If I'm not at home, I'm in hospital
Posts: 7,363
Thanks: 5
Thanked 8 Times in 5 Posts
drivetowin seems to know their stuff
Unless the wording follows a regular pattern so that you have words you can 'latch' the parsing on to then splitting a single string as you suggest automatically and reliably is nigh on impossible.

If the wording does follow a regular pattern then assuming you are using php you should be able to parse it using a combination of strpos and substr statements.
__________________
Never argue with idiots. They just drag you down to their level and then beat you with their experience.

If ignorance is bliss then some of the people I know must be orgasmic.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 27-02-06
Registered User
 
Join Date: Dec 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
CALLOW is an unknown quantity at this point
  Arrow

Hello Kbudden
Thanks for replying
Yeah i am using php & it is not impossible to parse it one can parse it but it will usually take lot of time which i can utilize in promoting my website
So i am looking for some code which will automatically parse it
Money is not an issue if somebody is looking to get paid for this i am ready.
i am repeating that string again which i want to be parsed

Sony Eric. K750i for 0.00 when you connect to Orange Your Plan 300 .With this offer you get 12 Months Half Price Line Rental

& this is one of the string from 2000 rows all are in the different row with different plan & incentive but in the same coloumn

Cheers

Last edited by CALLOW; 27-02-06 at 06:09 AM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 27-02-06
mike_01's Avatar
Life's changing...
 
Join Date: Nov 2005
Location: Planet_Zumbi
Posts: 295
Thanks: 4
Thanked 1 Time in 1 Post
mike_01 is an unknown quantity at this point
If im not wrong...even i tried getting something like this bt never succeed...
Let me know if you could get something like this..
All the best....
__________________
"Falling down is not Defeat....Defeat is when you refuse to get up."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 27-02-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
If you could post a few more examples that would help. It's the difference between being impossible (if the text is not predictable) and actually being relatively straight forward.

Post about 5 examples and we should be able to give more advice...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 27-02-06
Registered User
 
Join Date: Dec 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
CALLOW is an unknown quantity at this point
Hello dmorison
I am posting some of the strings here from that feed these are from the same coloumn of excel sheet but each in different row

1. Sony Eric. K750i for 0.00 when you connect to Orange Off Peak 1000 Crossnet .With this offer you get £160 Cashback

2. Sony Eric. K750i for 0.00 when you connect to Orange 1000 MINUTES OFFPEAK .With this offer you get 7 Months Free Line Rental

3. Nokia 6230i + Bluetooth for 0.00 when you connect to O2 O2 100 .With this offer you get 5 months free + bluetooth

4. Motorola V3 + Bluetooth Headset for 0.00 when you connect to O2 O2 200 .With this offer you get 7 Months At £0.99p + Bluetooth

5.Motorola V3 + Bluetooth Headset for 0.00 when you connect to O2 O2 100 .With this offer you get 7 months Free Line Rental + Bluetooth


Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 27-02-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
It looks like you're in luck - the system generating this feed is apparently combing fields from a database with "standard" text to make an English language description.

The way I would go about this would be to use a sequence of explode() calls on the known text; (which splits the text into an array); use the first element as the field that you're looking for, and the second as the input to the next itteration. Here's sort of how it would work:
PHP Code:
<?php
  $fields 
= array();  
  
$record = array();  
  
// start with the initial description in fields[1] for consistency  
  
$fields[1] = "Sony Eric. K750i for 0.00 when you connect to Orange Off Peak 1000 Crossnet .With this offer you get &pound;160 Cashback";
  
// get handset  
  
$fields explode("for ",$fields[1]);
  
$record["handset"] = trim($fields[0]);
  
// get price
  
$fields explode("when you connect to ",$fields[1]);
  
$record["price"] = trim($fields[0]);         
  
// get tariff
  
$fields explode(".With this offer you get ",$fields[1]);
  
$record["tariff"] = trim($fields[0]);  
  
// get bounty (which is what's left, if anything)
  
$record["bounty"] = trim($fields[1]);      
  
// display the extracted record
  
print_r($record);  
?>
In the above script, you end up with $record holding an associative array of the fields parsed out of the description. print_r() is a built in PHP function to display the contents of such an array. The above code outputs something like this:

Array
(
[handset] => Sony Eric. K750i
[price] => 0.00
[tariff] => Orange Off Peak 1000 Crossnet
[bounty] => £160 Cashback
)

All you need to do now is turn the above code into a function which accepts the description as input and returns $record and you should be in business. If you don't have the PHP code to read your source file line by line there are plenty of examples on fgets() and fgetcsv() pages at php.net. Please note that it will be quite easy to fool the above example code; so you would be wise to include validation on the output to ensure that it makes sense before use.

Last edited by dmorison; 27-02-06 at 12:49 PM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
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
Jewellery.tv Product feed popularity weighting field added - New Keyword List jewellery_tv Affiliate Window 0 25-02-05 06:44 PM
Product Data Feed System paidonresults Paid On Results 20 22-12-04 11:21 AM
Product Feed System Release TD Nick TradeDoubler 25 10-04-04 02:10 PM
eDirectory Affiliates Newsletter Pistol101 Affiliate Future 0 22-07-03 08:48 PM


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

Content Relevant URLs by vBSEO 3.2.0 RC7