Skip to content

Posts from the ‘Coding’ Category

12
Feb

Gaming Charts

Software

Charts

As you may be aware I enjoy looking at the stats that GamerDNA captures for XFire usage, it is a simple yet effective  method of showing how much time was spent and what percentage was spent on each game. I’m truely suprised that XFire doesn’t capture such data already.

At the start of January I reviewed my XFire data for the month of December, I wanted to see how frequently I played certain games. I pumped the data into the handy Google Chart API which then displays an image based on the information provided.

When February came around I wanted to do a similar task but rather than having to trawl through the data and craft the url to generate the Chart I decided to automate the process. So in a frenzied weekend of wracking my brain into remembering PHP, I created a page that automatically reads the RSS feed of my gamerDNA experiences and uses the XFire data held within to generate the URL for the Google Chart.

64px-gnome-x-office-spreadsheetsvg

After a few hours cursing at stupid errors I finally created a fully working tool that achieved the result I was aimming for. Once this had been tested a few dozen times it suddenly occurred to me that It would be easy enough to allow other GamerDNA members with XFire experiences to generate their own charts.

http://charts.welshtroll.co.uk/

It’s not all that pretty but providing the username entered has XFire experiences on GamerDNA in the last 30 days it will “hopefully” generate a nice little chart. I’m hoping to enhance the functionality to include the ammount of time played as well, but that can wait for now, small steps to start.

30
May

recaptcha

Coding

It seems the new functionality I added is working wonderfully. In the days since Sunday I've had no spam comments posted (touch wood) although there has been over 500+ hits from possible spammers.

It's quite funny that the spammers browser information indicates that they are using Java to run these automated spam scripts and there is no attempt to hide this fact. The worst offender on my website in the past 4 days was from a network in America registered to “AirlineReservations.Com, Inc.”. Which it turns out is a dubious natured website, mostly comprising of adverts.

A quick scout around revealed that this IP is indeed frequently responsible for spamming guestbooks and comment sections of websites all over the place. So as a further measure to reduce the number of bots that will be able to post spam comments I've been looking at an additional measure that I can implement. I've been following Project Honey Pot and schemes like it for sometime so I've decided to use one of their services, http:BL.

This blacklist service can be used to check the IP address of a visitor against the data held by Project Honey Pot. This will return 4 pieces of information:
A valid query response
The number of days since the IP was last active on the Project Honey Pot network
A Threat Score
And a type of visitor indicator

Using the last 3 pieces of information it should be possible to reduce potential spam attacks even further.

Updated 22:40
Well I've added new functionality to the comment pages that will now check against the blacklist. I'll monitor the traffic for the next week or so just to check that all is ok.

18
Mar

Tag Cloud

Coding

Of the growing number of 2.0 related stuff that is appear now-a-days, the tag clouds is an interesting one in that takes a standard list and tranforms it into other visual depictions.

I decide to have go at generating a simple cloud tag, I all ready had a list of news categories and the number of post in each one so I thought it wouldn’t be a step too far.
After quick Google to determine the best methods of displying the information, I decide that i would use a simple font size alteration based on the count of the category.

First tasks to decide on the number of levels I want to have in my cloud. I decided on 3 as this would allow enough differences for the total number I was dealing with.

So now we needed to split out the levels so when needed the highest possible count for 1 category and to divide by the number of levels we are using, this will give us the range of each level.

highest_category_total/number_of_levels = range

Now using the same information that we see in a standard list:
Topic1 = 3
Topic2 = 15
Topic3 = 8

Using a simple section of code to determine the level that each category falls into.

This example shows how it works

(highest_category_total/number_of_levels = range)
Range = 15 / 3

Level1 = 1-5 ( highest_category_total – Range *3)
Level2 = 6-10 ( highest_category_total – Range*2)
Level3 = 11-15 ( highest_category_total – Range)

therefore :
topic1 fails into level1
topic2 fails into level3
topic3 fails into level2