diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 981126f..c15ac22 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,6 @@ - - + - + @@ -249,7 +257,8 @@ - @@ -258,11 +267,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - + + + @@ -270,7 +306,9 @@ - + + + @@ -278,7 +316,9 @@ - + + + @@ -288,7 +328,9 @@ - + + + @@ -298,7 +340,9 @@ - + + + @@ -315,7 +359,9 @@ - + + + @@ -324,7 +370,9 @@ - + + + @@ -340,7 +388,9 @@ - + + + @@ -358,7 +408,9 @@ - + + + @@ -376,7 +428,9 @@ - + + + @@ -384,7 +438,9 @@ - + + + @@ -392,7 +448,9 @@ - + + + @@ -400,7 +458,9 @@ - + + + @@ -409,7 +469,9 @@ - + + + @@ -438,7 +500,6 @@ - @@ -459,9 +520,11 @@ - - - + + + + + diff --git a/checkins_page.jpg b/checkins_page.jpg new file mode 100644 index 0000000..186b7f0 Binary files /dev/null and b/checkins_page.jpg differ diff --git a/checkins_page1.jpg b/checkins_page1.jpg new file mode 100644 index 0000000..5b6f3c9 Binary files /dev/null and b/checkins_page1.jpg differ diff --git a/comment.jpg b/comment.jpg new file mode 100644 index 0000000..52e7f2f Binary files /dev/null and b/comment.jpg differ diff --git a/fbLogin.js b/fbLogin.js index 3bcfa3b..4f93afe 100644 --- a/fbLogin.js +++ b/fbLogin.js @@ -43,19 +43,27 @@ var login = function (callback) { }; var targetPage = function (callback) { - // page.open("https://m.facebook.com/story.php?story_fbid=103003277024225&id=100019436589542&fs=0", function (status) { - // if (status === "success") { - // window.setTimeout(function () { - // page.evaluate(function () { - // var el = document.querySelector('input[name="comment_text"]'); - // el.value = 'comment text'; - // MAjaxify.form(event, document.querySelector('form'), "async_composer", "cache", null, false); - // }); - // console.log('after comment'); - // phantom.exit(); - // }, 3000); - // } - // }); + page.open("https://m.facebook.com/story.php?story_fbid=103003277024225&id=100019436589542&fs=0", function (status) { + if (status === "success") { + page.evaluate(function() { + var nodeList = document.querySelectorAll('.story_body_container div[data-sigil="m-feed-voice-subtitle"] > a:first-child'); + var linksArr = Array.prototype.map.call(nodeList, function(el) { + return el.getAttribute('href') + }); + + setTimeout(function () { + var el = document.querySelector('input[name="comment_text"]'); + el.value = 'comment text'; + MAjaxify.form(event, document.querySelector('form'), "async_composer", "cache", null, false); + }, 3000); + }); + setTimeout(function () { + console.log('true'); + phantom.exit(); + }, 4000) + + } + }); // page.open("https://m.facebook.com/story.php?story_fbid=103003277024225&id=100019436589542", function (status) { // if ( status === "success" ) { @@ -97,22 +105,9 @@ var targetPage = function (callback) { // }, 1000); // } // }); - page.open("https://m.facebook.com/story.php?story_fbid=103003277024225&id=100019436589542&fs=0", function (status) { - if (status === "success") { - page.evaluate(function() { - window.setTimeout(function () { - var el = document.querySelector('input[name="comment_text"]'); - el.value = 'comment text'; - MAjaxify.form(event, document.querySelector('form'), "async_composer", "cache", null, false); - }, 3000); - }); - setTimeout(function () { - console.log('true'); - phantom.exit(); - }, 4000) - } - }); + + }; login(targetPage); \ No newline at end of file diff --git a/main_page.jpg b/main_page.jpg new file mode 100644 index 0000000..704f48d Binary files /dev/null and b/main_page.jpg differ