Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

Laterooms xml

Status
Not open for further replies.
Who was it that done this?
plus remember im not using wordpress

Try downloading the CSV file.

This may be a better alternative for you. I know someone on here recently built a site using their CSV file.

I've got to hand it to Laterooms though - they really take the time to build a relationship and seem to have a genuine interest in helping out.

If in doubt, ask for Colin.
 
just to say as well, im not needing alot of data from it, just an image, hotel name, little disc, price and then a button with a link to the page, thats it not alot, want to set them out each hotel into maybe a little table, or more likely in divs, but you guys have seen what i mean on other sites, This will help out so many people who want to use this

Thanks everyone
 
If you need to download everything then just put the stuff you need into your database with some simple if statements!

If you are planning to use Xml then just look into simplexml, then just open it in a text reader to have a look at the structure or vardump a couple of items to see how it is laid out.

I assume you will be dumping into a db and then calling it on php pages?
 
So is using the csv file going to be the easiest way to put it into exsiting html pages?
 
I'm calling the XML feed directly from PHP but find it a bit slow to respond.

Admin

Do you mean from the PHP that displays it on the front end? That will be quite slow if so.

It might be easier to put the info into a mySQL database and get it to update once or twice an hour with a CRON job.
 
Either way you should really be putting the data into a database because if page load takes a while it can affect the rankings with Google.

Have a look into Simple XML or CSV parsing, there is a good guide here about automating it.
 
lol i am so confused now, so many different answers lol

DOH
I think your trying to run here before you can walk I don't think your going to be able to achieve what you want to do using just plain HTML you'll need some sort of scripting to do what you want as others have said here PHP is probably your best option.
Theres millions of tutorials and code snippets out there on the web for free which you can probably use to bolt something together however you may also want to purchase a guide from somewhere like sitepoint I've found some of there ebooks useful reference for php
 
I'll give you some of my code to get you started, you can add as many of the fields they list in their documentation as you want to present. This one will parse out a list of hotels based on the KWORD entry e.g. "Leeds" showing 34 hotels.

Build your website design (using HTML is fine) but save the files as .PHP or it wont run:

Code:
<?php
// specify url of xml file
$url = "http://xmlfeed.laterooms.com/index.aspx?aid=11657&rtype=4&kword=leeds";
// get xml file contents
$xml = simplexml_load_file($url);

// loop begins
foreach($xml->hotel as $hotel)
{
// begin new paragraph
echo "<p>";
echo "<strong>Hotel Name:</strong> ".$hotel->hotel_name."<br/>";
echo "<strong>Hotel City:</strong> ".$hotel->hotel_city."<br/>";
echo "<strong>Hotel Description:</strong> ".$hotel->hotel_description."<br/>";
echo "<strong>Prices From:</strong> &pound;".$hotel->prices_from."<br/>";
echo "<strong>Hotel Link:</strong><a href=".$hotel->hotel_link.">click here</a><br/>";
echo "</p>";
// end paragraph
}
// loop ends

?>

Admin
 
ok thats I think im getting it now, and how will that bit of code look when it is displayed?

Thanks
 
ok thats I think im getting it now, and how will that bit of code look when it is displayed?

Thanks

For the Admin's code it would be something like this:

HOTEL Name
City
Some words and descriptions...
..........................................

Prices from £....
Click here to book

But at the same time if you site is static and you are not good at php then there is a learning curve involved.

I am now tweaking Shopperpress to take the laterooms csv feed. It is a bit of a pain as UK only csv is about 44MB! csv is updated weekly. I do really advice to parse csv if you are not fluent in xml. XML is not difficult, but you work with a "stream" meanwhile csv you feed into MySQL and work with "static" data.
 
My code will output like this Hotels in Leeds
but then I have little HTML in there and no style sheet to make it look pretty. This is easily added.

What I actually do is paste the code into a Wordpress page and it will run with my theme's design and framework ;-)
 
My code will output like this Hotels in Leeds
but then I have little HTML in there and no style sheet to make it look pretty. This is easily added.

What I actually do is paste the code into a Wordpress page and it will run with my theme's design and framework ;-)

But still, would you admit that XML integration for a php novice is more of a headache than simple csv into MySQL exercise? ;)
 
if i was putting the php into a exsiting html page, where would i have to put the php code, where i wanted it to display? or at the top of the page? in the head? and how would i go about wrapping each output into a div to style?
 
i suppose if I did this in wordpress it would be alot easier as you get all the plugins, but i know how to hand code websites in html and css and dont know anythgin about wordpress
 
Yes, other than the CSV files are HUGE and you have to remember to update them, unless you found a way to automate this?

Yep :( This is why I am working either on selective upload via small script +cron or checking options to use buy.at feed via Datafeed Studio.


if i was putting the php into a exsiting html page, where would i have to put the php code, where i wanted it to display? or at the top of the page? in the head? and how would i go about wrapping each output into a div to style?


Just give you file a .php extension and you can combine php and static html the way you want (providing you use opening <?php ).
 
does anyone know of anyone that is using this for a non wordpress site that I could look at there source code to check what I think I have to do is what i have to do, I will either give it a crack later or at the weekend,
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom