Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 23rd Aug 2010, 11:11 PM   #1
HyperActive Warrior
War Room Member
 
Join Date: 2010
Posts: 304
Thanks: 83
Thanked 71 Times in 28 Posts
Default
What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

So I am not completely new to programming. I've taken about 5 college level courses on C++, programing all basic datastructures and a small database/ file processing.

I also know some PHP, like I design a small user authentication site etc.

But I am a bit lost when it comes to bots, and other web automation programing.

Do you know how and where I can read up on this stuff? A good book, a good online tutorial? What language is commonly used for it? etc.

Thanks!

I am not a guru, nor do I pretend to be one. I am here to learn and to share my experience. Everything that I say, I say from my heart.
Porn Addiction Stop Porn with Candeo ; Overcoming Pornography Addiction. Sex Addiction Rehabs Porn Addicted Husband
feedtherightwolf is offline  
Unread 24th Aug 2010, 12:25 AM   #2
HyperActive Warrior
War Room Member
 
Join Date: 2007
Location: Virginia
Posts: 152
Thanks: 15
Thanked 25 Times in 19 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

Most commonly scrappers/bot are written in PHP/CURL however you can use other languages. If you are a complete noob (we all start that way) I highly recommend the book: Webbots, Spiders, and screenscrapers by Michael Schrenk...

It is a excellent starting point for any developer interested in learning how to create bots. Think of this book as the starting point of the rabbit hole It is the BEST published book on the subject I have read (and I have several)...

Cheers!


Jay

Got Tech Problems? PM me for quick help!

Need a psd converted into a website? --> Check out my new offer | 1 FREE review copy left!
jaywilsonjr is offline  
Unread 4th Mar 2011, 04:15 PM   #3
Warrior Member
 
Join Date: 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

I google this subject and there isn't much available. I did go to schrenk.com and watch the videos. Awesome stuff, I am definitely getting the book and taking the blue pill.

Guaranteed SEO Services
http://MakeItRainSEO.com
CAllenMartinson is offline  
Unread 4th Mar 2011, 04:41 PM   #4
HyperActive Warrior
War Room Member
 
Tashi Mortier's Avatar
 
Join Date: 2010
Location: Hesse, Germany
Posts: 349
Thanks: 33
Thanked 82 Times in 64 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

Hey thank you for this great book recommendation!

There are several ways to do this, one way would be to use the Firefox addon greasemonkey. It allows you to write scripts to adjust websites but I've also seen bots written with it.

cURL is great, too, and with PHP you have a simple scripting language to control it.

I think you know what to do now!

Want to read my personal blog? Tashi Mortier
Tashi Mortier is offline  
Unread 4th Mar 2011, 06:53 PM   #5
The Biggest Advert Online
 
RyanAndrews's Avatar
 
Join Date: 2011
Location: UK
Posts: 102
Thanks: 8
Thanked 12 Times in 12 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

One of the quickest way to deploy a bot in my experience, is using the humble wget, called from any language of your choice.
If you look at the man page, it can be configured any way you like.

RyanAndrews is offline  
Unread 5th Mar 2011, 10:56 AM   #6
Warrior Member
 
Join Date: 2010
Posts: 19
Thanks: 1
Thanked 4 Times in 3 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

perl + WWW::Mechanize.
McBob is offline  
Unread 5th Mar 2011, 12:38 PM   #7
Software Engineer
War Room Member
 
wayfarer's Avatar
 
Join Date: 2008
Location: Asheville, NC USA
Posts: 693
Thanks: 37
Thanked 112 Times in 100 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

Google's spider is written in Python. Python is faster than PHP, and can handle multiple threads, which PHP does not support. If you need something that will run continuously, there's no way you want to be using PHP. If not, PHP is probably a bit easier to use, especially if you have experience with it.

I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
wayfarer is offline  
Unread 6th Mar 2011, 09:25 AM   #8
HyperActive Warrior
War Room Member
 
Tashi Mortier's Avatar
 
Join Date: 2010
Location: Hesse, Germany
Posts: 349
Thanks: 33
Thanked 82 Times in 64 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

Originally Posted by wayfarer View Post

Google's spider is written in Python. Python is faster than PHP, and can handle multiple threads, which PHP does not support. If you need something that will run continuously, there's no way you want to be using PHP. If not, PHP is probably a bit easier to use, especially if you have experience with it.

You'd be surprised that there are actually people using PHP to program a Server. Facebook runs on PHP, too.

It's not the language that makes the difference, it's how you use it.

Want to read my personal blog? Tashi Mortier
Tashi Mortier is offline  
Unread 6th Mar 2011, 10:02 AM   #9
Software Engineer
War Room Member
 
wayfarer's Avatar
 
Join Date: 2008
Location: Asheville, NC USA
Posts: 693
Thanks: 37
Thanked 112 Times in 100 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Tashi Mortier View Post

You'd be surprised that there are actually people using PHP to program a Server. Facebook runs on PHP, too.

It's not the language that makes the difference, it's how you use it.
I'd be surprised??? PHP is my primary choice for web-development. But it doesn't support multi-threading and making it run continuously is a problem. Programming a spider typically has nothing to do with server programming. An HTTP server is a stateless machine: a request is made, information is processed, then the process dies.

Of course PHP can be made to run via a cron job, or can make requests to external pages in response to an HTTP request, but because of the nature of HTTP, and PHP's single-threaded nature, the request will not finish until the process has completed. If you just want to make simple scrapes of content in response to user requests, a simple file_get_contents() and some pattern matching is all you need, but in my experience this can cause huge overhead if you start getting a lot of requests to the server.

Python on the other hand was basically designed for networking tasks, and doesn't need a server to operate. It can run non-stop in the background, forever, as long as it's programmed well.

Java or Perl would also be good choices, if you're not looking for a "fire and die" process.

I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
wayfarer is offline  
Unread 6th Mar 2011, 10:49 AM   #10
HyperActive Warrior
War Room Member
 
Tashi Mortier's Avatar
 
Join Date: 2010
Location: Hesse, Germany
Posts: 349
Thanks: 33
Thanked 82 Times in 64 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

Well you can have a master PHP file that spawns child PHP processes etc. No problem there.

I have done that to search the web for proxy servers and check them once.

Want to read my personal blog? Tashi Mortier
Tashi Mortier is offline  
Unread 6th Mar 2011, 10:52 AM   #11
Warrior Member
 
ALee's Avatar
 
Join Date: 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

You can write a bot in any language of your choice. If you already know C++ and PHP, go for that! I wrote one in Visual Basic but PHP would be better since it's serverside.

Professional SEO Consultant - 6 Years of Experience
Want to hire me? Send me a PM!
ALee is offline  
Unread 6th Mar 2011, 11:50 AM   #12
Software Engineer
War Room Member
 
wayfarer's Avatar
 
Join Date: 2008
Location: Asheville, NC USA
Posts: 693
Thanks: 37
Thanked 112 Times in 100 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Tashi Mortier View Post

Well you can have a master PHP file that spawns child PHP processes etc. No problem there.

I have done that to search the web for proxy servers and check them once.
That's fine, but that has nothing to do with multi-threading. Multi-threading means using multiple cores on a processor. Still doesn't solve the "run continuously" problem. If it doesn't do that, it's not a "bot" as per the original question. It's fine for on the fly content scrapers though, nothing wrong with it.

I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
wayfarer is offline  
Unread 7th Mar 2011, 03:43 AM   #13
Warrior Member
 
Join Date: 2010
Posts: 19
Thanks: 1
Thanked 4 Times in 3 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

Originally Posted by ALee View Post

You can write a bot in any language of your choice. If you already know C++ and PHP, go for that! I wrote one in Visual Basic but PHP would be better since it's serverside.
You can write programs that run on your server in php, perl, visual basic, c/c++, asm,... It simply depends on your server.
McBob is offline  
Unread 8th Mar 2011, 12:01 PM   #14
HyperActive Warrior
War Room Member
 
Tashi Mortier's Avatar
 
Join Date: 2010
Location: Hesse, Germany
Posts: 349
Thanks: 33
Thanked 82 Times in 64 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

Originally Posted by wayfarer View Post

That's fine, but that has nothing to do with multi-threading. Multi-threading means using multiple cores on a processor. Still doesn't solve the "run continuously" problem. If it doesn't do that, it's not a "bot" as per the original question. It's fine for on the fly content scrapers though, nothing wrong with it.
That is not true, multi-threading means that you split up a running program into different independent threads. Now, you can either let the multi-threading get handled by the OS if you use different processes (just as with the Apache prefork module) or you can use different threads (requires you to either use the Windows or Unix API for those threads).

You can also let a PHP script run continuously on the command line, even as a server, I have created a script for a browser game that would constantly process events and run the combat system scripts in a separate process.

I think we should stop discussing this, though, because in the core we do agree and we are really taking this subject too far. I don't want to attack you in any way, wayfarer, I'm just excited that you can get nearly everything done in any programming language.

Want to read my personal blog? Tashi Mortier
Tashi Mortier is offline  
Unread 8th Mar 2011, 12:49 PM   #15
Software Engineer
War Room Member
 
wayfarer's Avatar
 
Join Date: 2008
Location: Asheville, NC USA
Posts: 693
Thanks: 37
Thanked 112 Times in 100 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Tashi Mortier View Post

multi-threading means that you split up a running program into different independent threads.
This is true, but my experience is that the new threads don't become useful unless you have more cores to work with.

Anyway, you're right, we're taking this whole discussion too far

I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
wayfarer is offline  
Unread 14th Mar 2011, 10:18 AM   #16
Online Business Advantage
War Room Member
 
Cliff_OBA's Avatar
 
Join Date: 2010
Location: Ontario, Canada
Posts: 87
Thanks: 3
Thanked 17 Times in 8 Posts
Default
Re: What Language Are Bots Written In and How to Learn it?
Share on: 
fb share twitter share gplus share more share

I was enjoying the threaded PHP discussion . But its probably nerdy enough as is.

For the OP, lately I have been using Ruby for any 'bot' type programming. There are a ton of useful libraries, and the community support is massive. I am in the middle of porting one of my personal scripts to PHP so I can deploy on my hosting account for others to use, and have found it takes a little extra code to do the same thing. But that works great, too.

At the end of the day, you want to choose a programming language you are comfortable with as most languages have the library support needed. Ones I have worked with:

Java, C#, VB.NET,Python, Perl, PHP, Ruby, Javascript (entirely possible, albeit difficult to scale to reasonable performance)

No need to use all of them, any one would do. Maybe not Javascript .

Cliff
Cliff_OBA is offline  
Closed Thread


Bookmarks

Tags
bots, language, learn, written


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 08:38 PM.