Advertisement
Guest User

Untitled

a guest
May 26th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. var interval = setInterval(function() {
  2. tokens.forEach(function(token) {
  3. var msg = messages[Math.floor(Math.random()*messages.length)]
  4. request({
  5. headers: {'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1'},
  6. url: `https://api.vk.com/method/wall.createComment?owner_id=${user_id}&post_id=${post_id}&from_group=1&message=${msg}&v=5.95&access_token=${token}`,
  7. method: 'GET'
  8. }, function (err, res, body) {
  9. if(body != "" && body != null) {
  10. if(body.includes("response")) {
  11. count++;
  12. console.log(`— Оставлен комментарий №${count}: ${msg}`);
  13. } else if(body.includes("captcha")) {
  14. console.log(`— Требуется капча`);
  15. } else {
  16. console.log(body);
  17. }
  18. }
  19. });
  20. });
  21. }, intervala);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement