JSON EAN PHOTOS V3
V3 PUSH
HTML
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<div id="hotelphotos"></div><div id="d"></div>
CSS
#d{font-size:19px}
#hotelphotos img {max-height:130px;width:auto;margin-left:3px;}
JavaScript
var hoteluniq = '418219'; // 418219 413233 254746 (good)
photosUrl = "http://api.ean.com/ean-services/rs/hotel/v3/info?minorRev=20&cid=55505&apiKey=sahaahrmg27wfg2acwcs3p2k&customerUserAgent=Mozilla/5.0%20(Macintosh;%20Intel%20Mac%20OS%20X%2010_8_2)%20AppleWebKit/536.26.17%20(KHTML,%20like%20Gecko)%20Version/6.0.2%20Safari/536.26.17&customerIpAddress=82.22.104.212&customerSessionId=0ABAA849-049C-B791-3D32-E9A87BB92A70&locale=en_US&options=HOTEL_IMAGES&hotelId=" + hoteluniq;
$.ajax({
url: photosUrl,
dataType: "jsonp",
beforeSend: function () {
$("#d").html('loading...');
},
success: function (data) {
if (data.HotelInformationResponse.EanWsError) {
$("#hotelphotos").append("Sorry, there are no photos at this time");
return false
} else {
var base = (data.HotelInformationResponse.HotelImages.HotelImage);
var Pics = [];
var thumbnailUrl = [];
$(base).each(function (eventID, eventData) {
// IMS
$(this).each(function (index, val) {
Pics.push("<img src='" + (val.url) + "' class='img-polaroid'>");
thumbnailUrl.push("<img src='" + (val.thumbnailUrl) + "' class='img-polaroid'>");
});
});
$("#hotelphotos").append(thumbnailUrl + "<hr>");
$("#hotelphotos").append(Pics);
} // end else
},
complete: function () {
$("#d").fadeOut('fast');
$("#hotelphotos > img").click(function(e){
alert($(this).attr('src'))
});
},
error: function (status) {
alert("request error:" + status);
}
}); // end photos
// end gather pics
function getLargeHotelPhoto(c){
var str = encodeURI(c);
str = str.replace('/s/','/s/');
return decodeURI(str)
}