Share
Go down
avatar
Posts : 2
Reputation : 1
Join date : 2018-03-11
Location : Frankfurt am Main, Deutschland
View user profilehttps://christian.froehlich.consulting

Happy Birthday Bot

on Sun Mar 11, 2018 1:15 pm
Hi I am trying to write a bot to say happy Birthday on Facebook... oh yes thats so personal... Very Happy
all I get is a reloading google.com page. What do I misunderstand?

Code:
//my settings
var userSettings = {}

//my variables
var birthdayText = 'Alles Gute zum Geburtstag!';
var startSite = 'h*ttps:/*/ww*w.fa*cebook.c*om/events/birthdays/*New members are not allowed to post external links or emails for 7 days*';

//my bot script
async function run(currentTab) {
  bot.generalProcedure()

  if (bot.getProtocol() == 'init') {
    bot.setProtocol('main')
  }

  if (bot.getProtocol() == 'main') {
    await bot.navigateUrl(startSite)
    bot.setProtocol('check_birthdays')
  }

  if (bot.getProtocol() == 'check_birthdays') {
      if (bot.selectElement({querySelector: textarea.uiTextareaAutogrow, indexOffset: 'first'}) == false) {
        bot.consoleLog('FINISHED: Keine Geburtstage gefunden.')
        bot.end();
      } else {
        bot.consoleLog('Geburtstag gefunden: Es wird gratuliert.')
        bot.setProtocol('happy_birthday')
      }
    }

  if (bot.getProtocol() == 'happy_birthday') {
      // B. selecting an element: takes a stardard js querySelectorAll argument
      await bot.selectElement({querySelector: textarea.uiTextareaAutogrow, indexOffset: 'first'})
      // C. mouseClick on selected element
      await bot.mouseClick({selectedElement: true})
      await bot.wait(500, 100)
      // D. typing a string, and then pressing the enter key
      await bot.keyboardType({string: birthdayText})
      await bot.keyboardType({special: 'enter'})
      // E. when clicking a page-changing button, it's wise to wait for the URL to load before continuing
      await bot.wait(2000, 100)
      await bot.waitForCondition({
        property: 'urlLoaded', equator: 'equals', condition: true,
        timeout: 20000
      })
    }

  setTimeout(function () { run() }, bot.getRunDelay());
}
avatar
Admin
Posts : 296
Reputation : 47
Join date : 2017-09-13
View user profilehttps://somiibo.com

Re: Happy Birthday Bot

on Mon Mar 12, 2018 12:35 am
Message reputation : 100% (1 vote)
Hey Tian!

I'm excited you're looking into making a custom module! You're one of the few who has expressed interest in checking it out so I apologize in advance if it's still a little buggy. I'll take a look at your module and see if I can figure out what's wrong and get back to you ASAP
avatar
Posts : 12
Reputation : 7
Join date : 2018-04-09
View user profile

Re: Happy Birthday Bot

on Sun Apr 22, 2018 11:10 pm
Message reputation : 100% (1 vote)
there seem to be something wrong with your begin link did not have much time today to look into it more i let you know!

avatar
Posts : 2
Reputation : 1
Join date : 2018-03-11
Location : Frankfurt am Main, Deutschland
View user profilehttps://christian.froehlich.consulting

Link

on Mon Apr 23, 2018 9:17 pm
Message reputation : 100% (1 vote)
Hi,

it was not possible for me to post a link here.

The link I used was: https://www.facebook.com/events/birthdays/
avatar
Posts : 12
Reputation : 7
Join date : 2018-04-09
View user profile

Re: Happy Birthday Bot

on Wed Apr 25, 2018 2:52 am
Message reputation : 100% (1 vote)
may make it so like it starts at google search up facebook then sign in to your account then after that go to the birthdays page and make it do it thing maby that is a bypass
Sponsored content

Re: Happy Birthday Bot

Back to top
Permissions in this forum:
You cannot reply to topics in this forum