DISCOVER
X

Just for Fun, PHP Unique Word Counter for Web Pages

February 14, 2013 1:00 am Leave your thoughts
Facebooktwittergoogle_plusredditpinterestlinkedinmailFacebooktwittergoogle_plusredditpinterestlinkedinmail

A few days ago I had a request to build a word counter for a website. One of the condition is that the words included in the count have to be unique. I couldn’t find any software or browser plugins that can do this straight away, so I decided to do a little PHP program that can do so.

The reasons I decided to create my own are:

  1. It should be simple enough to do.
  2. There are no performance restrictions, the software does not have to be fast as it would be used at, most once or twice every few months.
  3. There is no memory restrictions as we only run it locally.
  4. The count does not have to be 100% accurate, we only need estimation.

In the end I wrote the code and share it on github for those wanting to use it. The code works at bare essential. It supports proxies (for those behind firewalls), styled with twitter bootstrap, saves URL list into a file in JSON format and consist only of one core file. Very simple indeed.

At it core the code utilises in-build PHP functions and classes such as array_merge, array_unique, str_word_count and curl

You can get the code or fork it at: https://github.com/rvbd/simple-word-counter

As a note, remember that this counter is for estimating only and I have not tested the degree of accuracy.

Facebooktwittergoogle_plusredditpinterestlinkedinmailFacebooktwittergoogle_plusredditpinterestlinkedinmail
Tags: , , , ,

Categorised in: , ,