HCLonely / auto-task

此版本不再维护,新版本地址:https://github.com/HCLonely/auto-task-v4
https://auto-task-doc.js.org
MIT License
35 stars 4 forks source link

add instant gaming? #34

Closed Helpme0822 closed 3 years ago

Helpme0822 commented 3 years ago

Hi i wanted to ask if it's maybe possible to add instant-gaming here's a link to a giveaway:

https://www.instant-gaming.com/en/giveaway/ELOTRIX

HCLonely commented 3 years ago

Many of its tasks do not need to be really completed, you can use the following code to complete tasks other than facebook and youtube:

$('.ig-contest-social-box>div:not("[id]")>a').map((i, e) => {
  const isCompleted = $(e).hasClass('ig-contest-social-icons-participated')
  if (!isCompleted) {
    const link = $(e).attr('href')
    const channelid = $(e).attr('data-channelid')
    const isFacebook = $(e).hasClass('ig-contest-social-partner-fb') || $(e).hasClass('ig-contest-social-facebook-share')
    if (link !== '#') {
      if (isFacebook) window.open(link, '_blank')
      $(e).removeAttr('href')[0].click()
      $(e).attr('href', link)
    } else if (channelid) {
      window.open('https://www.youtube.com/channel/' + channelid)
    } else if (isFacebook) {
      e.click()
    }
  }
})
Helpme0822 commented 3 years ago

thanks for your answer but I added the code but nothing's showing up when I go on an instant-gaming like I don't get your program showing up to press the button so that it automatically completes the task. I pasted the code you sent at the end of the code. Did I do it wrong or do I have to add something else?

HCLonely commented 3 years ago

You shoule paste the code to the console(Ctrl + Shift + J) and then enter. image