Skip to content

Commit

Permalink
fixed broken cinema endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanmik committed Nov 25, 2013
1 parent 60f939d commit 7d09776
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion endpoints/cinema/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ app.get('/cinema', function (req, res, next) {
});

// Clean up image URL
var imgURL = movie.find('img.poster').attr('src').match(/\/images\/poster\/.+\.(jpg|jpeg|png)/ig)[0];
var imgURL;

try{
imgURL = movie.find('img.poster').attr('src').match(/\/images\/poster\/.+\.(jpg|jpeg|png)/ig)[0];
}catch(e){
console.log('Could not grab the image poster',e);
}

// Create an object of info
// and add it to the 'results' array.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"moment": "~2.1.0",
"xml2js": "~0.2.8",
"express": "~3.3.8",
"cheerio": "~0.12.2",
"cheerio": "~0.12.3",
"request": "~2.27.0",
"mocha": "~1.12.1",
"scraper": "0.0.9",
Expand Down

0 comments on commit 7d09776

Please sign in to comment.