Skip to content

Commit

Permalink
Fix URL encode in scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxattax97 committed Jan 22, 2017
1 parent 4ea0722 commit 9291308
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/newsServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ http.createServer(function (req, res) {
responseMsg = article.url + "\n";
responseMsg += article.title + "\n";
responseMsg += newNet.realname + "\n";
responseMsg += article.image;
if (article.img != null && article.img != undefined) {
responseMsg += article.image;
} else {
responseMsg += newNet.defImg;
}
}

console.log("POST data:", responseMsg);
Expand All @@ -147,7 +151,7 @@ http.createServer(function (req, res) {
responseMsg = scrapeData.url + "\n";
responseMsg += scrapeData.title + "\n";
responseMsg += newNet.realname + "\n";
if (scrapeData.img != null) {
if (scrapeData.img != null && scrapeData.img != undefined) {
responseMsg += scrapeData.img;
} else {
responseMsg += newNet.defImg;
Expand Down

0 comments on commit 9291308

Please sign in to comment.