Archive

Archive for February, 2010

Regular Expression to Validate URLs

February 10th, 2010 No comments

Here is a short regexp that is used to validate whether a user has entered correct URL address. Might be useful in any scripts dealing with user data.

I will show it as code:

preg_match(‘/^(http:\/\/|https:\/\/)([^\.\/]+\.)*([a-zA-Z0-9])([a-zA-Z0-9-]*)\.([a-zA-Z]{2,4})(\/.*)?$/i’, $_POST['url']);

It will check whether url suits the pattern. May not be ideal, but it’s working. :)

Simple Google SERP Parser in PHP

February 10th, 2010 No comments

If you need an easy way to extract all links from Google SERP page, here is the script:

<?
set_time_limit(0);
// Here is our search term
$search=”Test search”;
// Let’s prepare it for Google
$slovo=urlencode(trim($search));
// Here comes the Google URL
$google=”http://www.google.com/search?q=”.$slovo.”&num=10″;
// Let’s place all the links into a single file.
$links=fopen(“$slovo.txt”,”a+”);
// Getting the page contents from Google
$content= @file_get_contents($google);
// Simple and dirtty regular expression, that does the job :) $matches is the result.
preg_match_all(‘/<h3><a href=”([^">]+)/’, $content, $matches);
// Here are our urls: let’s echo them and write to a file
foreach ($matches[1] as $url)
{
echo $url.”\r\n”;
fwrite($links, $url.”\r\n”);
}
fclose($links);

?>

It works at the moment; Google might change the SERP output format, then you will need to change the regexp. The rest is very simple, this script should work on any host, even without cURL support.

Effective Time Tracking Software for Windows and Pocket PC

February 8th, 2010 No comments

Time management is an important thing today. If you don’t know how to manage your time, how to find time for great things, you will hardly achieve your goals. How to find out where is your time? You will need to track it, using a simple notepad, of a software package, if you like to do it more professionally.

I have been searching for an utility that allows to track time and to categorize it. Software should be able to create reports so I could see all my time spent at a glance.

There are some similar applications created for Linux. You can check Hamster, Gnotime (not supported), and Timebox : these are the most well known. I would like to show you an application, that can be run using Wine: Timepanic.

Timepanic is an application for tracking time spent at the computer (Windows version) and other time (Pocket PC edition). If you need to keep track of the work you do and when you do it, and want to stay on top of tracking projects or your business, then TimePanic is the ideal solution.

It allows you to improve your efficiency at work,keep on top of all your projects. watch an overview of all your priorities, see where the time is going in your day, see which projects/clients consume the most time. and many other features.

Timepanic is not only a computer application; it comes bundled with a Pocket PC version. It is used if you have a Windows Mobile Phone, or a Pocket PC, and you would like to track your time out of office. It is very useful to track traffic times, waiting, and any other activities that are a part of your life and you want to keep track of them.

The most useful thing of Timepanic as the ability to create reports. Reports will show you how much time is spent on each of your projects or time category so you could see it and make necessary changes.

If you are a time management fan, you must have this software.

Free PHP/MySQL Help Desk Software Script

February 8th, 2010 No comments

If you need to communicate with your customers to solve their problems, you definitely need a help desk. A place, where all most popular questions are answered and users have the ability to ask if anything remains unclear. If you are running a service, a web hosting, or anything else related to a big number of potential customers, help desk software will make it easier to communicate with them.

There are lots of help desk scripts available on the web. Everything depends on your current needs; if you’re installing it for the first time, you should better choose a free or open source solution. Here is a big list of software to choose from, but I will tell you a little about the script I really like. It’s Hesk.

IMHO, it’s a great script for a beginner and for a pro. Interface is very clear and you don’t even need a documentation, as it’s hard to do anything wrong with this script. Take a look at a screenshot:

Let’s find out what are the features:

Customer Interface:

* Submit new tickets
* Attach files
* Obtain detailed information from customers with custom fields
* SPAM prevention
* Suggest related articles before final ticket submission
* View existing ticket status
* E-mail notifications of staff replies
* Browse knowledge base

Knowledge base:

* Unlimited knowledge base articles
* Unlimited categories and subcategories
* Quick and Easy search capabilities
* Post attachments to articles
* Count article views
* List newest and most popular articles
* Rate articles

Administrator interface:

* Unlimited administrators and staff accounts
* Restricted access to some functionality for certain staff
* Powerful ticket search ability
* Manage knowledge base categories and articles
* Manage staff accounts
* Manage canned responses
* Customize help desk settings
* Modify your profiles and signatures
* Autoclose tickets after X days
* E-mail notifications of new tickets and replies
* Customers can easily rate staff replies
* Easy translation into any language

You are welcome to download your free version.

If you can propose any other simple and free scripts, please, post them in comments.