Posts Tagged “hiscores”

I’ve been asked a few times how my “near” realtime stat listing works in the side bar of this blog. So, this post will be a low down on how it works, and also my opportunity to give credit to those people who helped contribute knowledge to its design. The first thing I want to point out is the difference between my blogging software and my blogging host. WordPress.org is freeware blogging software. WordPress.com is a free blogging host service.  Notice the difference between the .org and .com.

My stat lister, which is nameless at this point, is a php script that I call using a specially designed php widget for WordPress.org.  WordPress.com, the free web blogging site, is fairly restrictive when it comes to what widgets and plugins are available for use to their members. There are many reasons for this, but security and stability are main issues. This site, Runescape Thoughts, is hosted by a different company than WordPress.com. I still use the free WordPress.org blogging software, but by going through a third party hosting service, I have the ability to run a much better selection of widgets and plugins.

The php widget for WordPress.org that I use is called the Executable PHP widget and can be downloaded at http://wordpress.org/extend/plugins/php-code-widget/. It is basically a modified version of the Text widget, but allows the execution of php code in addition to plain text and html.  It is this widget that allows me to run my stat listing php script.

My stat listing script if fairly straight forward, though it is also truly a Frankenstein’s monster of a script. I used ideas from various scripts already available on the Internet and pieced together something that I was fairly happy with. The script itself contacts Runescape.com and downloads the lite version of their highscore database for my player name. At that point it saves a cached version of this information to my server and will not contact Runescape.com again for at least 90 minutes. There really is no need for my own personal stats to be updated anymore than this often. Then the script parses the data, runs a calculator to determine my combat level, and then displays the results in a nifty table.

Contacting Runescape.com normally should be easy. But for some unknown reason my particular host server is having problems with DNS and communicating directly with the subdomain http://hiscore.runescape.com. Thankfully, I found someone (Marshian007) on the forums of my web hosting provider who came up with a rather novel solution to this issue, though it did involve hardcoding an ip-address directly into the script. Parsing the downloaded data is fairly easy and I basically used the format offered at http://runescapegod.com/webmaster.php. The combat calculator is just a very basic mathematical script I wrote using the formula devised by Max Waterman, Fern1970, Helcaterian, Oblivion590, Hans980 and Benmarchant. The icons in the chart are copyright Jagex Limited and I am using them under the fair use stipulations of international copyright law.

When I am comfortable with the script’s stability I may offer a link to a .zip version of it for others to use and dissect. Right now it is still in testing, and I want to add comments to the script that also directly credit those people who contributed it its creation.

Tags: , , , ,

Comments 2 Comments »

Runescape Thoughts © 2008 - 2009 Ryan Schuster, all rights reserved. Images are the property of Jagex Ltd. Jagex and RuneScape are registered trademarks of Jagex Limited. Though every effort is made to make sure that Grand Exchange Central data is updated daily and accurate, we and Ryan Schuster cannot guarantee the age or accuracy of the data provided within this website. All decisions made by viewers of this website are at their own risk. Data acquired by the Grand Exchange central is owned and copyrighted by Jagex Ltd.