Jump to content

Haighy

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by Haighy

  1. ......or could it be my IE interpreting it better than my host server because i see </ a7 voucherTypeId> when i do a print as mentioned
  2. Hi XSLT S I dont think it is that - please check out the source xmlhttp://api.tradedoubler.com/1.0/vouchers.XML;voucherTypeId=1?dateOutputFormat=iso8601?token=248487FBCA39B156B569D8F698C83FF27503CE8F looks ok to me
  3. using htmlspecialchars: <voucherList><voucher><id>9706</id><programId>898</programId><programName>Tesco.com</programName><code>TD-PRGM</code><updateDate>1356965680759</updateDate><startDate>1356908400000</startDate><endDate>1357513199999</endDate><title>5 off £30 on any Pre Order Games</title><shortDescription>5 off £30 on any Pre Order Games until 06.01.13 using code TD - PRGM (Offer ends 06.01.13. Excludes </shortDescription><description>5 off £30 on any Pre Order Games until 06.01.13 using code TD - PRGM (Offer ends 06.01.13. Excludes sellers)</description><voucherTypeId>1</voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(898)ttid(13)url(http://www.tesco.com/direct/gaming/pre-orders-games/cat15940025.cat?icid=ents_main_slot3 )</defaultTrackUri><siteSpecific>false</siteSpecific><landingUrl>http://www.tesco.com/direct/gaming/pre-orders-games/cat15940025.cat?icid=ents_main_slot3 </landingUrl></voucher><voucher><id>8255</id><programId>122698</programId><programName>Mothercare</programName><code>E4HD</code 3ff>< updateDate>1353600101304</updateDate><startDate>1353538800000</startDate><endDate>1369259999999</endDate><title>Deal's Week - Maclaren Techno XT</title><shortDescription>Deal of the Week - Maclaren Techno XT </shortDescription><description>This offer is valid on selected lines only (U0544, U1308, U1309, U3060, U0530), whilst stocks last. This offer cannot be used in conjunction with any offer/voucher code. Offer ends Monday 26th November 2012</description><voucherTypeId>1</voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(122698)ttid(13)url(http://www.mothercare.com/Maclaren-Techno-XT-Stroller---2012/LU1308,default,pd.html )</defaultTrackUri><siteSpecific>false</siteSpecific><landingUrl>http://www.mothercare.com/Maclaren-Techno-XT-Stroller---2012/LU1308,default,pd.html </landingUrl></voucher><voucher><id>2691</id><programId>2973</programId><programName>Lensway</programName><code>NEWLWC</code><updateDate>1345842074436</updateDate><startDate>1345759200000</startDate><endDate>1 3fe 361746799999</endDate><title>12% off Contacts+Free Delivery</title><shortDescription>New Customers get 12% off plus free Delivery for their first contact lens order from LensWay.co.uk</shortDescription><description>**New Customers** get 12% off plus free Delivery for their first contact lens order from LensWay.co.uk.; http://www.lensway.co.uk/contact-lenses</description><voucherTypeId>1</voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(2973)ttid(13)url(http://www.lensway.co.uk/contact-lenses)</defaultTrackUri><siteSpecific>false</siteSpecific><landingUrl>http://www.lensway.co.uk/contact-lenses</landingUrl></voucher><voucher><id>2688</id><programId>2973</programId><programName>Lensway</programName><code>RAYBAN</code><updateDate>1345841667876</updateDate><startDate>1345759200000</startDate><endDate>1361746799999</endDate><title> Complete Ray Ban Glasses £79</title><shortDescription>Starting at only £79 shop over 80 styles of Ray Ban glasses. Lenses & delivery included.</ 3fb shortDescription><description>Starting at only £79 shop over 80 styles of Ray Ban glasses. Lenses & delivery included.; Shop Ray Ban Glasses: http://www.lensway.co.uk/glasses/brands/ray-ban/cRayBanFrames-p1.html'>http://www.lensway.co.uk/glasses/brands/ray-ban/cRayBanFrames-p1.html;< /description><voucherTypeId>1</voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(2973)ttid(13)url(http://www.lensway.co.uk/glasses/brands/ray-ban/cRayBanFrames-p1.html)</defaultTrackUri><siteSpecific>false</siteSpecific><landingUrl>http://www.lensway.co.uk/glasses/brands/ray-ban/cRayBanFrames-p1.html</landingUrl></voucher><voucher><id>657</id><programId>81570</programId><programName>Microsoft Store UK</programName><code>WINDOWS35OFF</code><updateDate>1338298986356</updateDate><startDate>1338242400000</startDate><endDate>1369864799999</endDate><title>35% OFF Windows7</title><shortDescription>Promo code enabling 35% off all Windows 7 products.</shortDescription><description>Promo code enabling 35% off all Windows 7 products.</description><voucherTypeId>1</ a7 voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(81570)ttid(13)</defaultTrackUri><siteSpecific>false</siteSpecific></voucher></voucherList>
  4. Bumping this up as I really need the help here
  5. i have noticed that -1;-1;-1 and 3ff appears regularly - is this decoded xml elements?
  6. [/code] ok here is everything url: http://api.tradedoubler.com/1.0/vouchers.XML;voucherTypeId=1?dateOutputFormat=iso8601?token=248487FBCA39B156B569D8F698C83FF27503CE8F sample from print $TDResponse Tesco.comXMASTREAT13552454444571355180400000135699479999915% off F&F Limited Edition collection15% off F&F Limited Edition collection1http://clk.tradedoubler.com/click?a(2075091)p(898)ttid(13)url(http://www.clothingattesco.com/)falsehttp://www.clothingattesco.com/293718710hmvWQ2013464115928101346364000000135699479999920% off selected pre-orders20% off when yo 3ff u pre-order any one of the listed titles1http://clk.tradedoubler.com/click?a(2075091)p(18710)ttid(13)url(http://hmv.com/hmvwe...-1&pPageID=5701)falsehttp://hmv.com/hmvweb/navigate.do?ctx=1000;-1;-1;-1;-1&ctx=-1;5;-1;-1;-1&pPageID=5701293618710hmvPE2513464115474881346364000000135699479999925% off selected chart CD's25% off selected chart CD's enter code PE25 at checkout1http://clk.tradedoubler.com/click?a(2075091)p(18710)ttid(13)url(http://hmv.com/hmvwe...ch.do?ctx=1000; 3ff -1;-1;-1
  7. I do get data so that's what is confusing me. It seems that the XML parser can't interpret it though
  8. the more i read about this, it must be something to do with the decoding. I dont want to convert to JSON at this point. Does anyone have any ideas?
  9. i have compared the $TDResponse between my test pc and the web host and both look identical - therefore am still puzzled why one works and not the other. could be something to do with the xml header? <?xml version="1.0"?> i have similar xml structures which are correctly parsed (using the same technic) but have a slightly different xml header?xml version="1.0" encoding="UTF-8"?>
  10. if i do print $TDResponse - no xml structure is shown - is that expected? never checked before
  11. i also ran $TDurl in IE <?xml version="1.0"?>-<voucherList>-<voucher><id>9142</id><programId>898</programId><programName>Tesco.com</programName><code>XMASTREAT</code><updateDate>1355245444457</updateDate><startDate>1355180400000</startDate><endDate>1356994799999</endDate><title>15% off F&F Limited Edition</title><shortDescription>15% off F&F Limited Edition collection</shortDescription><description>15% off F&F Limited Edition collection</description><voucherTypeId>1</voucherTypeId><defaultTrackUri>http://clk.tradedoubler.com/click?a(2075091)p(898)ttid(13)url(http://www.clothingattesco.com/)</defaultTrackUri><siteSpecific>false</siteSpecific><landingUrl>http://www.clothingattesco.com/</landingUrl></voucher>
  12. Hi All I have a bizzar issue which is driving me nuts. I was running a php server on my pc to test my code with no issues - now moved it to the host server and get this issue when try to parse xml: Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Start tag expected, '<' not found in /websites/123reg/LinuxPackage22/tr/ad/in/tradingbay.co/public_html/Lib/Functions.php on line 154 here is my code: $TDurl = "http://api.tradedoubler.com".$Version.$module.$Format.$TDParams.$Token;print $TDurl;$TDResponse = @file_get_contents($TDurl);$TDParsed_Xml = simplexml_load_string($TDResponse);
  13. actually have found the solution thanks to your kind assistence i used this inside the foreach $NodeCount = $current ->count(); thanks again
  14. ahh sorry - I understand now. I did not see this line in your example $count = $ParsedXml->count(); Is it possible to put this count statement inside the foreach loop? each Product could have a different number of child nodes
  15. it is a statement so that count surely would not work as i don't know how many child nodes exist. the number is dynamic
  16. the number of child nodes is variable
  17. i am parsing through xml and want to know when i am at the end of a given 'Product' object ie when at </Product> he is my code $ParsedXml = simplexml_load_string($response); foreach($ParsedXml->Product as $current)( if (isset($current->name)) ( $name = $current->name, ) ...etc... ) I want to know when i am at the end of that Product object so i can write a line into a dabase before going through to the next one
  18. ok here is a question - do you know a really solid wrapper to this whole process which would display an animated loading image. obviously i would load the page within a <div> of the parent page but javascript i have is very flakey
  19. ok you've sold methat way i can keep track of what searches are being performed - apart from that i don't need to keep the information say after a week/month so when someone conducts a search, i check the database for the search string. If it does not exist, i then call the API to get it.if the user decides so sort/filter it is a fair assumption that it will be in the database but will put in a catch just in case many, many thanks for your time - now i need to learn the db handling logic
  20. i do have access to a database but not currently using one ( maybe i should) what would be the best way to remove the footprint of the search from the database once the user moves on in life. I don't want to be left with loads of results on the DB unnecessarily
  21. entry pointuser enters a string ' ie coffee machine' default display should show show all retailer prices grouped by the product title (ordered cheapest first) all product titles are ordered by relivance ( an internally generated rating based on product title & description in relation to search string) The user should then be able to only show products within a price brand only show products against a specific retailer choose how many items are displayed on screen ( default is all) possibly order the product titles by A-Z / Z-A or back to 'by relivance' all can be achieved by reloading the output page with different params but this will recall the api request In terms of data referece i use an array ( actually 3 dimensional ) Array [ Producttitle] = array [ Retailer ] = array [Price ] =valueArray [ Producttitle] = array [ Retailer ] = array =value
  22. to add a bit more detail - i want to present the data in a default fashion and display it. but, then allow the user to re-order and filter based on price, relivance, retailer etc so the page i guess will need to be reloaded? again seeking help the webpage is www.tradingbay.co and the section i am talking about is how to handle the search results - this website is still very much under construction so some of the links don't work :)any feedback would be well received
  23. The data size is not an issue at this stage and the 3rd party returns XML output so it just a case of stripping out the necessary items and displaying the data and being able to filter At the momment i load into a 2 dimension array - which can be sorted but requires the api call each time which is where i think i am not being efficient 3 interesting points made above: If i used javascript to sort/ order i am assuming i will still need to make the api request each time - or not ( i don't know much about this topic as am not very experienced ) The caching sounds like a really good idea so will look at the memcache link In terms of database, i could use it but the tables should be tempoary and again not sure how to do that
  24. Hi All Firstly, let me set the describe what i am trying to do: I have a php website which takes in a parameter(product) provided by the user via form. The php makes a request to a series of providers and gets back xml (details of the product). Currently i parse the xml and load it into an array which i then display on the screen via an html table. This works fine but is quite basic in terms of the offering to the user. Ideally i want the user to be able to filter or sort the results ( by price, by retailer, by relivance etc.. ). This presents me with a few challenges so am turning to this audience to steer me in the right direction hopefully .. If i continue using the array approach, from my level of experience (which is not good) it looks like i will have reload the php page by passing new parameters needed for the filtering/sorting and then make all the necessary requests again. To me this does not seem very efficient I was wondering whether the results of the requests could be stored into a session linked temporary table in a database and therefore filtering and search is easier and more flexible while only making the data request once from source. I know how to use tables but have no experience in temporary tables so not even sure if this is viable. volume of requests are low but needs to be a little scalable - doubt i will much intial traffic once up and running :)please help
×
×
  • Create New...