Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@InternetExplorer7
Created January 31, 2016 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save InternetExplorer7/b8d820e1d8030701a120 to your computer and use it in GitHub Desktop.
Save InternetExplorer7/b8d820e1d8030701a120 to your computer and use it in GitHub Desktop.
function findUnrealDeals(locationObj, message) {
var budget;
Promise.try(function() {
return model.findById(message.threadID)
}).then(function(oneModel) {
budget = getBudget(oneModel);
return bhttp.get("http://terminal2.expedia.com/x/deals/packages?originTLA=SEA&destinationTLA=" + locationObj.a + "&startDate=2016-02-01&endDate=2016-04-20&roomCount=1&adultCount=" + oneModel.participants.length + "&childCount=0&lengthOfStay=1,2,3,4,5,6,7,8&apikey=apikey");
}).then(function(expediaResponse) {
return expediaResponse.body.deals.packages
}).each(function(package) {
console.log('package: ' + package);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment