Skip to content

Commit

Permalink
comment with time out without cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
morozowandrey committed Jul 27, 2017
1 parent 7cd80f0 commit 38dd776
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 54 deletions.
115 changes: 89 additions & 26 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added checkins_page.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added checkins_page1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added comment.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 23 additions & 28 deletions fbLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) {
Expand Down Expand Up @@ -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);
Binary file added main_page.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 38dd776

Please sign in to comment.