Internet Explorer LogoIn a previous article, I mentioned that I had an application that could automate testing of websites using Perl. So, I now want to take a few minutes to share parts of that application with you. Actually, I’m only going to show you how to get started with IE automation by simply opening the IE browser and navigating to a specific URL. If you want to know how to do more things such as fill out forms, click links, or invoke buttons, just let me know in the comments below and I’ll be glad to show you all of those. For now, let’s keep it simple with just a few lines of code.

Continue reading »

Related Posts

Tagged with:  

Google Trends LogoIn a previous post, I showed you how to do screen scraping in Perl using the WWW::Mechanize module. Today I want to show you how to use that same application for getting the “Hot Trends” from Google. If you haven’t read “Write a Screen Scraper with Perl“, I would suggest that you take a couple of minutes and read that first. It isn’t a long article and shouldn’t take you more than a few minutes. And, it will give you the basics for what I’m about to show you here.

Continue reading »

Related Posts

Tagged with:  

ScreenshotThis is going to be a quick little tutorial showing you how to capture screenshots using the Perl programming language. You’re probably asking yourself, “why would I want to capture screenshots with Perl?” Well, for me the answer was I had written a script that could automatically test web pages with Perl. I’ll show you how to do that another day. But for now, back to my explanation. My web page testing tool included the capability of recognizing server errors such as Error 500, Error 404, Error 403, etc… It also had the capability of checking for client side errors. So, I needed to include something that could take a screenshot of what the screen looked like at the moment the error occurred. That’s where this little tool came in handy. It’s extremely easy to do and only requires a few lines of code. So, let’s get to it.

Continue reading »

Related Posts

Tagged with:  

Coffee FilterSince I’m beginning to get backed up with “real” work, today is going to be the last of my Perl tutorials for a while. But, don’t worry. I’ll still be writing articles. They just won’t be Perl related. However, since this is my last Perl article for a while, I’m going to share with you something that I’ve actually used for one of my money making websites.

A few years back, I owned a website for a local dating service. The site was actually growing in size. But, due to other circumstances that arose & got my attention, I didn’t have much time to invest into the website and finally decided to shut it down. One of the issues that the dating site faced on a daily basis was users uploading images that were a little more revealing than what our terms of service allowed for. Even though you had to be at least 18 years old to register with and use the site, we still refrained from allowing users to upload images that were publicly viewable and that violated our terms. When uploading images, you could specify that the images contained too much nudity and flag them as private only. This meant that only people you were “friends” with on the site could view these images. Unfortunately, we had a lot of users that refused to flag the images as “adult content” or for private viewing only. So, we had to do something about it.

To counter users violating our terms, I wrote a filter that could check images for nudity and would automagically flag them if they did in fact violate our terms of service. To do this, I wrote a Perl script that could accept an image as its parameter which was checked for a certain color range. If the image contained more than a specified percentage of colors within that range, the image was flagged and either set as private or was rejected all together. With the already existence of a Perl module designed specifically for this, the script was extremely easy to incorporate. Let me show you how easy it was.

Continue reading »

Related Posts

Tagged with:  

Web Crawler / SpiderOver the years, I’ve gotten a ton of requests from people asking me to teach them how to create a web crawler (or spider as some call them). Since I am still deciding on whether or not to release a search engine that I wrote a few years ago and have been using for personal use since, I can’t get into too many details about some of the most important pieces that go into a crawler since my search engine has a crawler of its own. However, I can show you a dumbed down version of a crawler that I wrote several years back using Perl. It is just a basic spider that crawls websites looking for more URLs to crawl. Note: This is not the best or most efficient way to create a web crawler. But, it is a working crawler that you can extend to make a better crawler of your own. Also, another key note of creating a web crawler is that I’ve found that there are other, better languages to write a web crawler in than Perl. But, since I’m not using Perl for my own web crawler and I can dumb down the Perl version enough for a basic example, I’m going to share it with you now.

Continue reading »

Related Posts

Tagged with: