From 66d7323ddc6f50ff831cc745ee83aba1864ac90f Mon Sep 17 00:00:00 2001 From: caesar_chi Date: Sat, 26 Apr 2014 17:18:15 +0800 Subject: [PATCH 01/17] update for app main --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index fa1a400..da1590c 100644 --- a/app.js +++ b/app.js @@ -12,7 +12,7 @@ var url = "http://graph.facebook.com/Boo/photos?type=uploaded"; http.createServer(function (req, res) { res.writeHeader(200, {"Content-Type": "text/html"}); - // res.setHeader("Content-Type", "text/html"); + var data = "" request.get(url, function (err, body, response) { From 7e238118b0c9ffa67e53359cc9370222fa718a18 Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 18:14:36 +0800 Subject: [PATCH 02/17] Update app.js --- app.js | 62 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/app.js b/app.js index da1590c..2051189 100644 --- a/app.js +++ b/app.js @@ -1,32 +1,42 @@ -/** - * @overview - * - * @author - * @version 2014/04/26 - */ - var http = require("http"); -var port = 1337; var request = require("request"); -var url = "http://graph.facebook.com/Boo/photos?type=uploaded"; - -http.createServer(function (req, res) { - res.writeHeader(200, {"Content-Type": "text/html"}); - - var data = "" - request.get(url, function (err, body, response) { - - response = JSON.parse(response); - response.data.forEach(function (val, idx) { - data += ""; - }); - - data += ""; - res.end(data); - }); +var port = 1337; -}).listen(port); -console.log("start server port: " + port); +var url = "https://graph.facebook.com/2014.hsnu.at.ntu/photos?type=uploaded"; +//JSON is a global module not need to require// + +http.createServer (function(req, res) { + + var datas = ""; + + request.get(url, function (err,body,result) { + + + result = JSON.parse(result); + result.data.forEach(function (val,idx) { + if (val.comments != null){ + datas += "" + + //data += "

this


"; + //data += "
"; + //datas += "

" + val.images[1].source + "

"; + datas += "
"; + val.comments.data.forEach(function (tt,idx){ + datas += "

" + tt.from.name + "

"; + datas += "

" + tt.message + "

"; + //console.log(datas); + }); + } + }); + datas += result; + res.end(datas); + }); + datas += ""; + console.log("run"); + console.log(datas); + +}).listen(port); +console.log("Server Created\nPort Number : "+port); From fc0de4581257df78e4fd54168a87ecb1e356e87c Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 18:22:57 +0800 Subject: [PATCH 03/17] update app.js --- app.js | 55 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/app.js b/app.js index da1590c..f6b5cc0 100644 --- a/app.js +++ b/app.js @@ -1,32 +1,43 @@ -/** - * @overview - * - * @author - * @version 2014/04/26 - */ - var http = require("http"); -var port = 1337; var request = require("request"); -var url = "http://graph.facebook.com/Boo/photos?type=uploaded"; +var port = 1337; + + +var url = "https://graph.facebook.com/2014.hsnu.at.ntu/photos?type=uploaded"; +//JSON is a global module not need to require// + -http.createServer(function (req, res) { - res.writeHeader(200, {"Content-Type": "text/html"}); +http.createServer (function(req, res) { + + var datas = ""; - var data = "" - request.get(url, function (err, body, response) { + request.get(url, function (err,body,result) { + + + result = JSON.parse(result); + result.data.forEach(function (val,idx) { + if (val.comments != null){ + datas += "" + datas += "" + ""; + datas += ""; + datas += "

" + tt.message + "

"; + //console.log(datas); + }); + datas += "" + } - response = JSON.parse(response); - response.data.forEach(function (val, idx) { - data += ""; }); - - data += ""; - res.end(data); + datas += result; + res.end(datas); }); + datas += ""; + console.log("run"); + //console.log(datas); }).listen(port); -console.log("start server port: " + port); - - +console.log("Server Created\nPort Number : "+port); From 715c51d76b12d1b7de405de5b919f0346131d7d7 Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 18:26:56 +0800 Subject: [PATCH 04/17] update app.js --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index f6b5cc0..7052a55 100644 --- a/app.js +++ b/app.js @@ -13,7 +13,7 @@ http.createServer (function(req, res) { request.get(url, function (err,body,result) { - + //~~~ result = JSON.parse(result); result.data.forEach(function (val,idx) { if (val.comments != null){ From 90c3eac4fe9ef1a4baa2e9364f6b09f94d7f2a14 Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 18:30:17 +0800 Subject: [PATCH 05/17] update2 app.js --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 7052a55..cda9db2 100644 --- a/app.js +++ b/app.js @@ -13,7 +13,7 @@ http.createServer (function(req, res) { request.get(url, function (err,body,result) { - //~~~ + //~~~~~~ result = JSON.parse(result); result.data.forEach(function (val,idx) { if (val.comments != null){ From 4263e28c2f3ee08420532950f88574f983128414 Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 18:39:17 +0800 Subject: [PATCH 06/17] lalala --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index d15f4bc..f84eb2e 100644 --- a/app.js +++ b/app.js @@ -14,7 +14,7 @@ http.createServer (function(req, res) { request.get(url, function (err,body,result) { - //~~~~~~~~~~ + //~~~~~~~~~~~~~ result = JSON.parse(result); result.data.forEach(function (val,idx) { if (val.comments != null){ From a316e1d5686a9a872805ba69ccde12c7c38afa9d Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 19:32:30 +0800 Subject: [PATCH 07/17] xxx --- Procfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..207d22f --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: node app.js \ No newline at end of file From 2126cc10753529309aac70e1a0baa621c0e04b78 Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 19:44:46 +0800 Subject: [PATCH 08/17] conflict --- app.js | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/app.js b/app.js index f84eb2e..f6695de 100644 --- a/app.js +++ b/app.js @@ -1,8 +1,6 @@ var http = require("http"); var request = require("request"); var port = 1337; -<<<<<<< HEAD - var url = "https://graph.facebook.com/2014.hsnu.at.ntu/photos?type=uploaded"; //JSON is a global module not need to require// @@ -37,48 +35,5 @@ http.createServer (function(req, res) { }); datas += ""; console.log("run"); - //console.log(datas); -======= ->>>>>>> 7e238118b0c9ffa67e53359cc9370222fa718a18 - - -<<<<<<< HEAD -======= -var url = "https://graph.facebook.com/2014.hsnu.at.ntu/photos?type=uploaded"; -//JSON is a global module not need to require// - - -http.createServer (function(req, res) { - - var datas = ""; - - request.get(url, function (err,body,result) { - - - result = JSON.parse(result); - result.data.forEach(function (val,idx) { - if (val.comments != null){ - datas += "" - - //data += "

this


"; - //data += "

"; - //datas += "

" + val.images[1].source + "

"; - datas += "
"; - val.comments.data.forEach(function (tt,idx){ - datas += "

" + tt.from.name + "

"; - datas += "

" + tt.message + "

"; - //console.log(datas); - }); - } - }); - datas += result; - res.end(datas); - }); - datas += ""; - console.log("run"); - console.log(datas); - -}).listen(port); ->>>>>>> 7e238118b0c9ffa67e53359cc9370222fa718a18 console.log("Server Created\nPort Number : "+port); From 111b4f4bd762695f43e435e5e2aa008340b3c709 Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 19:49:26 +0800 Subject: [PATCH 09/17] lalala --- app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app.js b/app.js index f6695de..250a040 100644 --- a/app.js +++ b/app.js @@ -35,5 +35,6 @@ http.createServer (function(req, res) { }); datas += ""; console.log("run"); +}).listen(port); console.log("Server Created\nPort Number : "+port); From b96fe03e513db6f602d6c0e391a89870de528f64 Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 19:56:35 +0800 Subject: [PATCH 10/17] hehehe --- app.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 250a040..6577312 100644 --- a/app.js +++ b/app.js @@ -6,7 +6,7 @@ var url = "https://graph.facebook.com/2014.hsnu.at.ntu/photos?type=uploaded"; //JSON is a global module not need to require// -http.createServer (function(req, res) { +/*http.createServer (function(req, res) { var datas = ""; @@ -36,5 +36,11 @@ http.createServer (function(req, res) { datas += ""; console.log("run"); }).listen(port); +*/ +//console.log("Server Created\nPort Number : "+port); +http.createServer(function(req,res){ + var datas += "hello~~~~"; + res.end(datas); +}).listen(port); -console.log("Server Created\nPort Number : "+port); +console.log("Server Created \n"); From ce43feb403491cb5d45226d109f97a1ac305a529 Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 20:08:05 +0800 Subject: [PATCH 11/17] heheh --- app.js | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/app.js b/app.js index 6577312..38bd139 100644 --- a/app.js +++ b/app.js @@ -1,12 +1,12 @@ var http = require("http"); var request = require("request"); -var port = 1337; +var port = 5000; var url = "https://graph.facebook.com/2014.hsnu.at.ntu/photos?type=uploaded"; //JSON is a global module not need to require// -/*http.createServer (function(req, res) { +http.createServer (function(req, res) { var datas = ""; @@ -17,16 +17,13 @@ var url = "https://graph.facebook.com/2014.hsnu.at.ntu/photos?type=uploaded"; result.data.forEach(function (val,idx) { if (val.comments != null){ datas += "" - datas += "
Facebook Messages
"; + datas += "
" + val.comments.data.forEach(function (tt,idx){ + + datas += "

" + tt.from.name + "

" + ""; - datas += ""; + datas += "

" + tt.from.name + "

"; datas += "

" + tt.message + "

"; //console.log(datas); }); - datas += "" } }); @@ -36,11 +33,6 @@ var url = "https://graph.facebook.com/2014.hsnu.at.ntu/photos?type=uploaded"; datas += ""; console.log("run"); }).listen(port); -*/ -//console.log("Server Created\nPort Number : "+port); -http.createServer(function(req,res){ - var datas += "hello~~~~"; - res.end(datas); -}).listen(port); -console.log("Server Created \n"); +console.log("Server Created\nPort Number : "+port); + From bc0df14c6cc1df46eb9a82b8ff71cb6cb01e9cfd Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 3 May 2014 20:09:07 +0800 Subject: [PATCH 12/17] heheh --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 38bd139..ae5b777 100644 --- a/app.js +++ b/app.js @@ -1,6 +1,6 @@ var http = require("http"); var request = require("request"); -var port = 5000; +var port = Number(process.env.PORT || 3000); // to deploy on Heroku!!!!!!!~~~~~~~~ var url = "https://graph.facebook.com/2014.hsnu.at.ntu/photos?type=uploaded"; //JSON is a global module not need to require// From 669a14994f9d8e795483131fe7af2c933ce7a73b Mon Sep 17 00:00:00 2001 From: lulalachen Date: Tue, 16 Dec 2014 11:52:19 +0800 Subject: [PATCH 13/17] branch --- test.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..1e2c201 --- /dev/null +++ b/test.txt @@ -0,0 +1,4 @@ +test +weifjw + +asdjlsakldjlaksjdlka From 762de15cd0123a2d1634cdf3745325e17b346ac1 Mon Sep 17 00:00:00 2001 From: lulalachen Date: Tue, 16 Dec 2014 12:16:58 +0800 Subject: [PATCH 14/17] delete --- test.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test.txt b/test.txt index 1e2c201..efc8fa1 100644 --- a/test.txt +++ b/test.txt @@ -1,4 +1,2 @@ test weifjw - -asdjlsakldjlaksjdlka From e47e03400dbc8710aa42543ba6193d179cd49e4c Mon Sep 17 00:00:00 2001 From: lulalachen Date: Tue, 16 Dec 2014 12:21:30 +0800 Subject: [PATCH 15/17] new --- test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test.txt b/test.txt index efc8fa1..28698c2 100644 --- a/test.txt +++ b/test.txt @@ -1,2 +1,3 @@ test weifjw +sdjldsjfkjsldkfj From 4e1482985acf9e7b9c0128d8dd54082c7d6224cf Mon Sep 17 00:00:00 2001 From: lulalachen Date: Tue, 16 Dec 2014 12:26:43 +0800 Subject: [PATCH 16/17] modified --- test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.txt b/test.txt index 28698c2..231cbfb 100644 --- a/test.txt +++ b/test.txt @@ -1,3 +1,3 @@ test weifjw -sdjldsjfkjsldkfj +aasdssasdjldsjfasdasdasasaddasadkjsldkfj From c536674f74b408b0652aebb309d67ecbee9d0f20 Mon Sep 17 00:00:00 2001 From: lulalachen Date: Sat, 31 Jan 2015 23:36:14 +0800 Subject: [PATCH 17/17] first --- test.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/test.txt b/test.txt index 231cbfb..efc8fa1 100644 --- a/test.txt +++ b/test.txt @@ -1,3 +1,2 @@ test weifjw -aasdssasdjldsjfasdasdasasaddasadkjsldkfj
Facebook Messages
"; - datas += "
" + datas += "
"; val.comments.data.forEach(function (tt,idx){ - datas += "

" + tt.from.name + "