Scrape Google Blog Search With PHP

March 28th, 2008

I’m currently lacking real “bloggable” ideas, so here’s something simple and hopefully useful – a PHP script to get the blog search results from Google. The script is provided strictly for educational purposes, blah blah blah. And by the way, if you only need the top X results, it would be simpler to use the […]

Continue Reading...

Free Tools for Natural Language Processing

March 13th, 2008

I’ve compiled a list of various Python modules and functions that I found most useful in certain Natural Language Processing tasks. For easier skimming, the list is grouped by NLP task, such as tokenization and tagging.

Continue Reading...

WordPress Version Survey

March 10th, 2008

A while ago I saw the blog version survey at BlogSecurity.net and got an idea to do my own. The previous survey is more than 8 months old and several new WordPress version have been released since then, so I think a new study is in order 🙂 I collected a large list of WordPress […]

Continue Reading...

Get Google Image Search Results With PHP

February 28th, 2008

Google Image Search doesn’t get as much time in the spotlight as the “normal” Web Search, but it’s still useful for things like finding suitable illustrations for an article (Flickr also comes to mind). Whatever you use it for, you can often get results faster with a bit of automation. Here’s a simple PHP script that can parse and return the results of any Image Search query. For education purposes only.

Continue Reading...

Extracting The Main Content From a Webpage

January 25th, 2008

I’ve created a PHP class that can extract the main content parts from a HTML page, stripping away superfluous components like JavaScript blocks, menus, advertisements and so on. The script isn’t 100% effective, but good enough for many practical purposes. It can also serve as a starting point for more complex systems.

Continue Reading...

How To Highlight Nofollow With Opera & More SEO Tools

January 9th, 2008

A review of a free Opera plugin that can highlight nofollow links, display Alexa rank and PageRank, show the number of backlinks that a page or a domain has, and more. Basically it is a full-featured SEO toolbar for the Opera web browser.

Continue Reading...

Why Nofollow Didn’t Work – A Different Perspective

January 7th, 2008

It is no secret that the introduction of the rel=nofollow completely failed to stop, or at least decrease link spam on blogs, forums and similar sites. The possible reasons, and the negative effects of Nofollow on legitimate users, have been discussed to death, but still I feel there is one aspect of the problem that has been overlooked.

Continue Reading...

Detect Users Accessing Your Site Via a Proxy

November 23rd, 2007

The are many reasons why someone might want to detect if users are accessing their site via a proxy. For one, all spammers use proxies. Proxies can also be used to cheat voting systems, create multiple accounts when only one account is allowed or make it appear like the user is browsing from a different […]

Continue Reading...

Comment Spam Down By 96% – It’s Simple

November 17th, 2007

For months I’ve been getting dozens of spam comments, sometimes over a hundred per day. Most of them are caught by Akismet, which is great. The problem is that with high numbers of spam comments it’s virtually impossible to look through the spam filter logs and de-spam false positives. The bandwidth and processing power wasted […]

Continue Reading...

Make A WordPress Plugin Now! – Plugin Generators of Doom

November 10th, 2007

I’ve been following WP plugin development-related news for a week or two now, and I’ve noticed something that could make creating a plugin easier – plugin generators. These tools can create a handy template for your new plugin so you don’t need to start completely from scratch; you still need to know (at least) PHP to make your plugin do anything useful, though. In this post I’ll review three WordPress plugin generators I’ve come across.

Continue Reading...

See Which Plugins Have Update Notifications Enabled

November 7th, 2007

I’ve added a new feature to my single-click WorPress plugin updater – now you can see which of your plugins are checked for updates. Those plugins that have update notifications enabled will be marked by a golden bar-thingy in the “Plugins” tab. This is useful to see which plugins will notify you when an update […]

Continue Reading...

How To Run A PHP Script In The Background

October 16th, 2007

If you have a PHP script that takes a while to execute (for example, long database operations or file format conversions), you might want to run it in the background so that the rest of your page still loads fast. In this post I’ll describe two ways to do this. Launching a background process One […]

Continue Reading...

PHP Frameworks Are Evil

October 10th, 2007

Shoot Yourself in The Foot More Efficiently If you’re unfamiliar with how frameworks function, trying to use a framework for a new project will bring trouble. With all the complexities frameworks bring, new bugs will come, too. Besides, small one-man projects typically don’t require a framework. MVC Isn’t A Framework-exclusive Feature See the bare-bones MVC […]

Continue Reading...

How To *Really* Upload Files With PHP

October 8th, 2007

I’ve noticed that whenever I search for a “php upload script” or “how to upload files”, the first page of Gogle results is full of pages that tell you how to handle file uploads = letting users to upload something to your server. But what if you actually want to create a PHP script that […]

Continue Reading...

Checking If Page Contains a Link In PHP

September 25th, 2007

Sometimes it is necessary to verify that a page really contains a specific link. This is usually done when checking for a reciprocal link in link exchange scripts.

Continue Reading...

PHP Multithreading – Faking It

August 20th, 2007

PHP doesn’t really support multi-threading per se but there are ways to do “fake” multithreading. Here’s one I saw in the PHPClasses.org newsletter – Multi-thread Simulation. Note that this class is intedend for use on a webserver, as opposed to running PHP scripts from a command line (or similar). Check the end of this post […]

Continue Reading...

How To Force File Download With PHP

August 12th, 2007

Say you want a PHP script that will make the browser to download a file instead of opening it. This is useful for common filetypes that would normally be displayed in a browser, like .html, images, PDFs and .doc files. You can find a lot of scripts that do this on the web but one […]

Continue Reading...

WordPress Killed My Code

August 2nd, 2007

…but that’s okay – WP-Syntax resurrected it. After looking at one of my earlier posts I noticed that all the backslashes were gone from my code examples, most notably my regular expressions. I had the code wrapped in <pre></pre> tags. As some searching revealed, this seems to be a recurrent bug in WordPress 2.2.1 (I […]

Continue Reading...

How To Check If Page Exists With CURL

August 2nd, 2007

Here’s a relatively simple PHP function that will check if an URL really leads to a valid page (as opposed to generating “404 Not Found” or some other kind of error). It uses the CURL library – if your server doesn’t have it installed, see “Alternatives” at the end of this post. This script may […]

Continue Reading...

How To Read/Write Icons With PHP

July 30th, 2007

I discovered this interesting PHP class today that can be used to process all kinds of .ico files in PHP. Features Read/write icon files. Extract individual icons from a multi-icon file as GD icon resources. Add new icons to an .ico file. Supports all icon image sizes, bit depths and transparency. You can find the […]

Continue Reading...

Web 2.0 Is Cool

July 23rd, 2007

Not “cool” like “the concept of web 2.0 posesses a large amount of coolness” or “web20.cool == true“. For many people Web 2.0 equals “cool”. That’s what I understood after reading this fine blog post. Programmers and the like might know Web 2.0 is about things like AJAX, social networking, “folksonomies” et cetera. Some might […]

Continue Reading...

A Silly Way To Get Backlinks

July 22nd, 2007

The 3 Easy Steps Create an application It doesn’t have to be anything special. One way is to find a free screensaver builder and use a bunch of royalty-free photos to make your own slideshow screensaver. Make the application freeware – it’s easier and faster. If you actually create something worthy, you might set up […]

Continue Reading...

Counting del.icio.us Linkbacks – Not Yet

July 21st, 2007

I’ve seen people asking on the Internet if there’s a way to get a list of the most bookmarked pages from a specific site. Some other social bookmarking services (like Digg) have this feature but del.icio.us doesn’t. This looked like an interesting problem so I decided to write a script that would crawl a given […]

Continue Reading...

Concurrent Processing And PHP+MySQL, And Challenges Abound

July 19th, 2007

What would you do if you wanted to run several instances of a PHP script that each work on a portion of a MySQL table, without interfering with each other and trying to grab the same rows? I don’t know the correct answer to this, but here’s what I did. It’s a rant, yeah.

Continue Reading...

How To Extract All URLs From A Page Using PHP

July 16th, 2007

A PHP function that extracts all URLs from a page and another one that translates a relative URL to absolute URL. Originally I wrote this for a crawler script.

Continue Reading...

Installing Scripts – The Eternal Questions

July 14th, 2007

If you’ve ever written a server-side script intended for distribution (as opposed to personal use), you’ve probably encountered the problem of needing to write a tutorial detailing the installation and setting up of the script. There are several typical tasks that you might need to describe – setting file permissions, creating a database, etc. Don’t […]

Continue Reading...

Logging In With CURL and PHP

July 7th, 2007

This is an example of how you can use CURL to “log in” and retrieve some protected info. I’ve showed the somewhat extreme case where you need to maintain cookies, spoof HTTP referer and use SSL. The example page used here is ClickBank – one of the largest digital product retailers. I’ve tried to comment […]

Continue Reading...

Squidoo MDK Problems

July 6th, 2007

No response from Squidoo about my countdown module yet, so I’m going to write about some problems I encoutered with the Module Development Kit. This is going to be technical and Squidoo-specific, so beware. A bit of background : Squidoo offers a SDK for module development. This SDK (or MDK as it’s called) comes with […]

Continue Reading...

A Countdown Module for Squidoo?

July 4th, 2007

Recently I decided to take a look at Squidoo and almost immediately I noticed they offered a Module Development Kit. After checking out the list of “Most Wanted” modules it seems a countdown module is a fairly popular idea and should be easy enough to do. A countdown module would basically “count down” to a […]

Continue Reading...

Click Heatmaps for Everyone

June 22nd, 2007

(Another obscure topic here… yay!) One day not too long ago I remembered the “website heatmap” buzz (not so popular anymore now) and wondered whether I could/should create a software that could generate heatmaps for any particular website. Note that originally the phrase “website heatmap” was used to refer to an overlay image showing where […]

Continue Reading...