1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Tutorial] Simple AddMeFast bot using Selenium

Discussion in 'Black Hat SEO Tools' started by ikstob, Nov 19, 2012.

  1. ikstob

    ikstob Junior Member

    Joined:
    Nov 12, 2012
    Messages:
    147
    Likes Received:
    129
    Location:
    ikstob.com
    Home Page:
    I'm working on a handful of bots/tools which will all be free/open-source for the community to use and improve upon. In some cases they'll do some pretty advanced things on their own, in other cases they'll give you a base to build easily build your own tools and methods. I just wanted to share a simple example of how to use Selenium to automate a mind-numbingly boring task. This example is all written in Java but you could do much the same thing using Selenium's Python or C# bindings.

    Basically this example is a working AddMeFast bot ... it just logs into Facebook, logs into AddMeFast, and then sits doing the "Facebook Likes" task all day long :)

    Some of the neat tricks you can do from Selenium is inject JavaScript into the current page, this makes clicking buttons etc. very easy. Check the source code below (i'm too new to post the link, but figure it out). Because its all Java code you can run it on Windows, Mac or inexpensive Linux VPS's very easily.

    Source code: gist_github_com/4113207

    Skill required: Intermediate

    Requirements:
    - Java 1.6
    - Java development environment Eclipse/Netbeans
    - Libraries for Selenium
     
    • Thanks Thanks x 5
    Last edited: Nov 19, 2012
  2. tajmahal

    tajmahal Regular Member

    Joined:
    Nov 28, 2009
    Messages:
    294
    Likes Received:
    53
    this is noobish question but do i need some software or what????
     
  3. ikstob

    ikstob Junior Member

    Joined:
    Nov 12, 2012
    Messages:
    147
    Likes Received:
    129
    Location:
    ikstob.com
    Home Page:
    Yes, you will need a basic Java build environment such as Eclipse IDE and the necessary libraries from Selenium. I'm preparing a series of tutorials from beginners to advanced levels about 'botting' from Java - check back soon?
     
  4. metra

    metra Junior Member

    Joined:
    Jun 6, 2012
    Messages:
    156
    Likes Received:
    49
    Location:
    -. ..- .-.. .-..
    That's an awesome library mate (Selenium), and great implementation :) I was doing this before through .NET's default browser (IE) and an extremely limited library
    that made automating submit actions such as buttons frustrating.
     
  5. cooooookies

    cooooookies Senior Member

    Joined:
    Oct 6, 2008
    Messages:
    1,008
    Likes Received:
    216
    Yeah, Selenium is an awesome library, using it every day. Currently, I am trying to improve the htmlunit-driver, which unfortunately leaks memory. Anybody else facing this?


    For those who are not familiar with git (like me), get the jkstob stuff with

    git clone git://gist.github.com/4113207

    nice starter though.
     
  6. ikstob

    ikstob Junior Member

    Joined:
    Nov 12, 2012
    Messages:
    147
    Likes Received:
    129
    Location:
    ikstob.com
    Home Page:
    Thanks for your comments metra & cooooookies, that was just a really basic starter .. more people should really be using Selenium - it rocks! :)

    The "htmlunit-driver" is definitely a bit buggy/leaky, I've opted for using real browsers (Firefox/Chrome) running "headless" on Linux VPS's using the X virtual frame buffer (Xvfb). I can run 8-10 sessions reliably on an expensive VPS. It turns out my code was a little over-efficient racking up 6,000 points doing Facebook likes until I got hit with Phone Verification, on the bright side it made me implement the code to do Twitter following/tweets, Pinterest follows and YouTube views/likes. (will post updated code shortly)
     
  7. willo556

    willo556 Guest

    Woah, I never knew Java was that similar to C#! Anyway, cheers shall be trying this out :)
     
  8. ikstob

    ikstob Junior Member

    Joined:
    Nov 12, 2012
    Messages:
    147
    Likes Received:
    129
    Location:
    ikstob.com
    Home Page:
    If you use Apache Maven (a Java-based compile/build tool) to build/run this example its a piece of cake, here is the Maven pom.xml file gist_github_com/4119305 and I've done a short video of an updated version which does YouTube views and solves the captcha challenge: youtu_be/0FV4eNEjLaA

    Happy Hacking! :)

    Logs of the bot running during the above video:
    Code:
    16:23:26,574  INFO AddMeFastBot:414 - Starting task 'youtube_views'...
    ... snip ...
    16:49:58,838  INFO AddMeFastBot:288 -    ... 'watching' video
    16:50:28,839  INFO AddMeFastBot:319 -    ... solving captcha
    16:50:30,146  INFO AddMeFastBot:77 - 40 views, 1153 points, running for 1624 seconds
    16:50:38,847  INFO AddMeFastBot:288 -    ... 'watching' video
    16:51:08,848  INFO AddMeFastBot:319 -    ... solving captcha
    16:51:10,110  INFO AddMeFastBot:77 - 41 views, 1158 points, running for 1664 seconds
    16:51:17,509  INFO AddMeFastBot:288 -    ... 'watching' video
    16:51:47,510  INFO AddMeFastBot:319 -    ... solving captcha
    16:51:48,788  INFO AddMeFastBot:77 - 42 views, 1163 points, running for 1703 seconds
    16:51:56,971  INFO AddMeFastBot:288 -    ... 'watching' video
    16:52:26,972  INFO AddMeFastBot:319 -    ... solving captcha
    16:52:28,228  INFO AddMeFastBot:77 - 43 views, 1168 points, running for 1742 seconds
    16:52:39,164  INFO AddMeFastBot:288 -    ... 'watching' video
    16:53:09,165  INFO AddMeFastBot:319 -    ... solving captcha
    16:53:10,438  INFO AddMeFastBot:77 - 44 views, 1169 points, running for 1784 seconds
     
    Last edited: Nov 20, 2012
  9. willo556

    willo556 Guest

    Oh man, I cannot figure this maven thing out for the life in me... Ummm could you link me the library files that I need to import into eclipse? :)
     
  10. ikstob

    ikstob Junior Member

    Joined:
    Nov 12, 2012
    Messages:
    147
    Likes Received:
    129
    Location:
    ikstob.com
    Home Page:
    Sure, no problem Selenium includes just about everything there is as dependencies! :eek:)

    I've just chucked the first commit into GitHub you can get the example source, all the dependencies and the build file from: ikstob_com or go direct to GitHub: github_com/ikstob/botski
     
    • Thanks Thanks x 1
  11. ./v3xr

    ./v3xr Newbie

    Joined:
    Sep 26, 2012
    Messages:
    44
    Likes Received:
    14
    This is the first I've heard of Selenium, the example makes it look like a piece of cake though! Will definitely look into using this for some future plans, thanks a million!
     
  12. ikstob

    ikstob Junior Member

    Joined:
    Nov 12, 2012
    Messages:
    147
    Likes Received:
    129
    Location:
    ikstob.com
    Home Page:
    I've just updated the example code and added a README to the GitHub project: github_com/ikstob/botski

    Just to re-iterate, this is just example code .. but its *very* easy to extend it to do many more things.
     
  13. sebastjan

    sebastjan Registered Member

    Joined:
    Aug 27, 2012
    Messages:
    96
    Likes Received:
    11
    ikstob I'm also java progammer PM your skype, maybe we could do something together..
     
  14. ikstob

    ikstob Junior Member

    Joined:
    Nov 12, 2012
    Messages:
    147
    Likes Received:
    129
    Location:
    ikstob.com
    Home Page:
    I'm not on Skype yet, will let you know when I am.
     
  15. flybeta

    flybeta Junior Member

    Joined:
    Feb 7, 2009
    Messages:
    185
    Likes Received:
    14
  16. karupoiss

    karupoiss Elite Member

    Joined:
    May 16, 2012
    Messages:
    1,634
    Likes Received:
    515
    Gender:
    Male
    Location:
    Europe
    Home Page:
    Thanks for the code I guess but it's pretty much useless as we are not programmers and to get this thing up and running is a real pain in the ass.
     
  17. handmadebots

    handmadebots Senior Member

    Joined:
    Nov 8, 2012
    Messages:
    904
    Likes Received:
    204
    Home Page:
    nice, thanks :)
     
  18. smartmobilesigns

    smartmobilesigns Newbie

    Joined:
    Nov 14, 2012
    Messages:
    5
    Likes Received:
    0
    nice try!
     
  19. cyberxcrime

    cyberxcrime Newbie

    Joined:
    Nov 21, 2012
    Messages:
    16
    Likes Received:
    0
    I don't understand anything.
     
  20. krompir

    krompir Newbie

    Joined:
    Jul 22, 2009
    Messages:
    4
    Likes Received:
    0
    OP, how does your bot solve the U-tube views captcha (the "select image with false position" one) ?
    tnx