This weekend was uneventful, just as I like it..

Friday I started work on the function to automatically collect data for any given game within our database. This required a modified version of the scraper script I wrote for MetaCritic.com. Pulling a game from our database, I rewrite it to MC’s URL standards ie. “Random Game Name: Goes Here” should be sent as “random-game-name-goes-here”. After rewriting the name, I simply pull the page with all the games details, parse through it and grab all the data to populate that specific row. I ran into a minor snag while pulling the publisher’s line. I had written a simple str_replace for single whitespace, but hadn’t thought they would use tabs – how stupid of me to think the developers of another website would actually use web standards. So I wrote an additional function to clean up any type of whitespace that I may encounter, be it a space, linebreak, tab or anything else.

Saturday I focused on the administration panel. I quite enjoy working in HTML5 and CSS3, and I have written the front-end of the admin panel in them (We can’t write the main website in html5 and/or css3 since not all browsers support them, yet). I started and finished the dashboard, member management and game management pages. Since this is a public blog, I can’t go into much more detail than that as it would be a security risk. I also went out to the Pittsford plaza with Nikki. Parking was horrendous. I drove around the parking lot for about 10 minutes before I found an empty spot. Parking at Wegmans was easier, and I didn’t have to back out – always a plus for me.

Today (Sunday) I set my focus on cleaning and consolidating code on the pages for the main site and space within the database. I had a broad idea of what I wanted to accomplish, so I set to work. First thing that had to be done, was removing the vast amount of space being used within the database for the timelines. I simplified it by creating a simple string split into three chunks (a|b|c). Not only will this save us an average of 82% space over a life-time, but it simplifies our job and allows us to create dynamic posts. Whereas having set posts would consume more resources trying to parse them all out piece by piece and use more space within our database. Checking the type of post (a), allows us to use the correct display template. B and C are used for the actual dynamic data, whether it be a user, game, or something else.

Now that I had written the basic string for dynamic posts, I had to convert the old code over and test it out. I hit a snag that had me randomly cursing to myself. Turns out I had missed a single character in one of my regex matches. Hate it when that happens… Fixed it, tested and works – yay! All posts are now dynamic, and can be changed through an array which can have strings added or removed at any time through the admin panel.

Think I’m done for the night, since my eyes are starting to tweak meaning that I need a break from staring at my lcd’s.