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

what language i need to know for writing bots

Discussion in 'General Programming Chat' started by forvenz, May 26, 2013.

  1. forvenz

    forvenz Regular Member

    Joined:
    Jan 25, 2013
    Messages:
    454
    Likes Received:
    56
    you know like GSA , scrapebox ,google/youtube serp checker . all of these great software
    what i need to know to code them . i know PHP SQL CSS HTML and all the web bullshit ,and little bit C#
     
  2. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,111
    Likes Received:
    1,712
    Location:
    Banana Republic
    You can develop all of the above tools you've mentioned with any programming language like C#, Java or Delphi, just to mention a few. You can certainly develop the bots with C# as you already knew it.
     
  3. forvenz

    forvenz Regular Member

    Joined:
    Jan 25, 2013
    Messages:
    454
    Likes Received:
    56
    i know C# from the start until class . yeah i know this is nothing ,short story long what i need to know in c# to do suck these things
     
  4. saxgod

    saxgod Regular Member

    Joined:
    Sep 19, 2010
    Messages:
    351
    Likes Received:
    337
    if ur still starting in c# and want to build "windows aplication" i would start looking at WPF
    if you start doing WPF and want to have a flexible application look into data bindings from viewmodels to xaml, or in short: MVVM patterns. you might like "prism" if u want to make it modular.

    for the bot part you can use sockets or http libraries, and run them in multiple threads..
     
  5. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,111
    Likes Received:
    1,712
    Location:
    Banana Republic
    Easiest thing to start is with browser automation using C#'s webbrowser control, Watin, SimpleBrowser or similar libraries. There are many such libraries available and choose one of them depending on your requirement.

    Complex bots require knowledge to handle HTTPWebRequest & HTTPWebResponse from within the bot.

     
    • Thanks Thanks x 1
  6. forvenz

    forvenz Regular Member

    Joined:
    Jan 25, 2013
    Messages:
    454
    Likes Received:
    56
    hi guys its doesn't must to be c# if you think there is better language for the things i need tell me ,and it will be very nice if you refer me to good places to learn .
     
  7. Layhooo

    Layhooo Newbie

    Joined:
    Jun 2, 2013
    Messages:
    23
    Likes Received:
    4
    You can make rudimentary bots with the java Robot class. I made a youtube automessenger and account switcher with this. If you want to make more complicated bots you'll have to learn about Sockets which is what I'm doing right now
     
  8. seospade

    seospade Newbie

    Joined:
    Jun 16, 2013
    Messages:
    27
    Likes Received:
    0
    Java Robot class would be better for you for bots writing. But as exactly i know is that there may be complex bots which require knowledge to handle HTTPWebRequest, etc.
     
  9. theMagicNumber

    theMagicNumber Regular Member

    Joined:
    May 13, 2010
    Messages:
    345
    Likes Received:
    195
    HttpWebRequest/HttpWebResponse, WebClient or HttpClient for C#
    It is easier with requests than with browser emulators in the long run.
    Also don't forget the Thread and Task classes and System.Collections.Concurrent namespace.
    Download http://fiddler2.com/ and investigate the http headers.


    PHP does not support multithreading, you can use fork() to spawn new processes, but i don't think this is the ideal solution and it will be harder to synchronize the processes. Someone that is more proficient in php, might shed some light on this matter.
     
  10. lietuvis002

    lietuvis002 BANNED BANNED

    Joined:
    Aug 3, 2012
    Messages:
    2,415
    Likes Received:
    2,576
    java, after programming c ++ for few years I am going to java for making seo tools and android apps
     
  11. PizzaPill

    PizzaPill Newbie

    Joined:
    Aug 20, 2012
    Messages:
    39
    Likes Received:
    21
    Location:
    Berlin
    Something a little bit out of the ordinary: Ruby. Its a very fun language and there are many libraries that are perfect for bots. The https://github.com/vcr/vcr and http://nokogiri.org/ come to mind. Additionally there is alot available to run browsers on linux boxes in headless mode.

    The cons of using Ruby: It might be slower compared to C#, C/C++ and Java & you have a much harder time programming a decent GUI, altough for a Bot a CLI (Command Line Interface) should suffice and there are great libraries for that too (https://github.com/erikhuda/thor).
     
    • Thanks Thanks x 1
  12. Riseing

    Riseing Regular Member

    Joined:
    Aug 15, 2010
    Messages:
    341
    Likes Received:
    83
    I write all my stuff in Ruby, best choice I ever made was to learn it
     
  13. archert22

    archert22 Newbie

    Joined:
    Jun 26, 2013
    Messages:
    23
    Likes Received:
    2
    I'll have to agree with this. I've been programming for years and although my personal philosophy is most programming languages are the same, and they're just tools and not really a "best" one, I would still highly recommend Ruby.

    Why?

    - Ruby has been adopted as the language of choice for the Rails community and has HUGE support in the way of it's modules (Gems) it supports.
    - Ruby is very, very good at string manipulation. So if you need to do any scraping or logic around strings, Ruby is great.
    - Ruby is spiritual successor to Perl, which was probably the most widely used scripting language 10-15 years ago. As such, there's still some old code out there and if you know Ruby, you can read Perl pretty well.

    All in all, I'd suggest Ruby, then Python. I'd go with interpreted languages as they're a lot easier to write scripts for and to deploy.

    I hope this helps! Best of luck!
     
  14. LasVegas702

    LasVegas702 Newbie

    Joined:
    Dec 24, 2012
    Messages:
    36
    Likes Received:
    13
    Look into PHP with cURL... lots of things can be done
     
  15. dannyhw

    dannyhw Senior Member

    Joined:
    Jul 16, 2008
    Messages:
    980
    Likes Received:
    462
    Occupation:
    Software Engineer
    Location:
    New York City Burbs
    I do almost everything with PHP/cURL, but yeah there are issues like having to spawn new processes for threading and it being a fucking chore to create a UI. Before I did web apps I did all my bots in VB6/winsock. The Microsoft stuff is easy and you can hack together stuff that works from the top down.

    The thing is a few years ago I switched to Mac so the thought of having to program on a PC makes me ill. The .net framework itself is just terrible too. Java would probably be my next choice, but I just haven't made it a point to learn. Not as fast to develop as in PHP but it's fast and you can build good multithreaded cross platform apps, even if you end up just making thin clients to layer over PHP scripts.
     
  16. killersoft

    killersoft Newbie

    Joined:
    Jul 8, 2013
    Messages:
    12
    Likes Received:
    5
    Occupation:
    software developer
    Location:
    Poland
    If you want writing more bots, not only single solution, then I wouldn not recommend you PHP - it has a very poor, or almost none of multithreading functionality.

    I am programmer with about 8 years of experience (several years in PHP) and I would suggest you to use Java, with Robot/Apache Http Client.

    Remeber that in Java you can write real WEB APPLICATIONS, not only dynamic pages. The differnce is that web application works 100% time with some background services/threads wich
    you can monitor throught web interface with servlets and JSP. This is huge difference nad a lot better solution than forcing PHP to constantly refresh with CRON etc.

    Of course, Java learning path is a lot more complicated.

    And don't listen to ony opinion that Java is slow - if someone say this, then it knows nothing about Java. Java totaly blows php/perl and others in terms of efficiency, only C++ can be a better but not so much.
     
    • Thanks Thanks x 2
    Last edited: Jul 10, 2013
  17. ttrox

    ttrox Regular Member

    Joined:
    Jun 28, 2013
    Messages:
    217
    Likes Received:
    75
    It's true that Java might be as fast as PHP but it is way more bloated than PHP is. However I would say Java is best for these types of applications as coding in Java is -somehow- easy and it's easy to create multi-threaded applications. PHP is a no-go for these things except a few kind of situations when it might come in handy (as php gets even simpler than Java).
     
  18. bartosimpsonio

    bartosimpsonio Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 21, 2013
    Messages:
    8,839
    Likes Received:
    7,450
    Occupation:
    ZLinky2Buy SEO Services
    Location:
    ⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩
    Home Page:
    As much as I dislike PHP, it's definitely not a no-go. Robots can be written in PHP and run from the command line. Having said that, Perl, Python and Ruby are much better for bots than Java or anything compiled.
     
  19. killersoft

    killersoft Newbie

    Joined:
    Jul 8, 2013
    Messages:
    12
    Likes Received:
    5
    Occupation:
    software developer
    Location:
    Poland
    PHP is not so good. First, ultra bad multithreading, nad cUrl-multi is a tiny funcionality in concurrency which gives you almost nothing. Also, whole error-handling pipeline is a mess - with PHP, you can write bot in some propabilistic way like, queuing task and then, veryfying all of them - I can't count how many PHP solutions i saw in ma career where creator thought that it just works, maybe with 90% efficiency, but the truth was that it was less than 2-3%. You can have many silent problems with PHP, and it is hard to catch/handle/log all errors in single place, it is very unconsistient and you should always write another bot to verify your primary bot work. In other languages, where all possible errors are thrown as exeptions it is a lot better.

    Also real time monitoring is almost impossible in PHP - you can store status in database and monitor it from for example web page - huge workaround and definatelly not real-time.

    And definately, not compiled languages (Java is) will be much much much slower, sometimes killing your possibilities (captcah decoding, DOM/HTML parsing etc etc).

    Also you can forget about GUI in PHP, and embedding web browser in your application, also you cannot simulate "real mouse" clicks, only some web events with selenium server, which also restricts Bot writing possibilities.

    So, definately we can say that is not a good language for writing:
    -reliable
    -functional
    -fast
    bots, only some tiny scirpts to scrap/post simple things, or use extarnal simple apis, with small reliabiliti/monitoring capabilities.
     
  20. bartosimpsonio

    bartosimpsonio Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 21, 2013
    Messages:
    8,839
    Likes Received:
    7,450
    Occupation:
    ZLinky2Buy SEO Services
    Location:
    ⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩
    Home Page:
    PHP wasn't made to be multithreaded. If you need multithreading with PHP just write one script to do a job and use the OS to span hundreds of PHP processes, surely your OS is properly multithreaded ;)