The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Reading from "Captcha" images.

A while ago I used to play a game called Midnite Challenge, a credit based multiplayer powered by PHP. Unless your life revolved around the game or you spent a great deal of money you wouldn't do well. The reason being, you were given credits every 10 minutes, and there was a limit as to how many one could have at any given time. Needless to say this limit was met every 8 hours, in other words, while you slept. An old friend of mine developed a desktop application in C++ that could:

1) Log out when someone else logs in (There was a list of those who were online, you gave the application a list of usernames and it compared them against said list.).
2) Effectively manage credits (Say the limit was 1,000 credits, and you'd like to have 800 when you returned. Once 800 had built up it would begin to use them.).
3) Display random statistics in the application (Such as what the application had done for your recently, how many credits you've got now, what proxy it was hiding behind.).
4) Bypass "Captcha" image verification (Compared the current image to a number of images that were known to complicate things.).

My question is, is Ruby suited for something like this? I know that Ruby can send post data and keep track of cookies, eliminating numbers 1 and 2. I've never dealt with it personally, but I would imagine that the Ruby TK could take care of number 3. Number 4 is what I'm really concerned with, I've spend the last hour searching Google with no luck, surely there has to be a way. Maybe there isn't, is something this complex limited to the likes of C++, Java, and dare I say it, Python?

Sure. You could use the RMagick or GD libraries to read the image data I think, that is how I would create such scripts in PHP. In C++ it is a bit easier because you can have direct access to certain image resources... I'm not too sure about Ruby though.

Yeah, now that you mention it, the C++ application was using a widely available OCR. I just checked out RMagick, it does have an image to text function, but that's just for storing images in memory. Thanks for the response, perhaps there are other ways to go about this.

Yeah, now that you mention it, the C++ application was using a widely available OCR. I just checked out RMagick, it does have an image to text function, but that's just for storing images in memory. Thanks for the response, perhaps there are other ways to go about this.

Hi,

Well of course there'd be no "image to text" function because that'd quickly defeat the purpose of a CAPTCHA You have to program in yourself a method that reads that image.