ON The Insider: Avril Too Sexy for Malaysia
CNET Networks Entertainment:
GameSpot
GameFAQs
SportsGamer
MP3.com
TV.com
Metacritic
  •  
  • jrclem
  • Level: 34 (8%) 
  • Rank: Paramecium
  • Member since: May 14, 2003
  • Last online: 08/27/08 6:11 pm PT
  • My Emblems:
    • Moderator
    • General Moderator
    • Neighborly
    • Virtually There: E3 2008 GameSpot Show Sushi
    • I voted
    • Burning Crusader
    • After Hours: Virtually There
    • MK Scream It Contest
    • Moderator
    • General Moderator
    • Neighborly
    • Good Taste
    • PC Aficionado
    • Artistic Genius
    • Readers' Choice 2005 Chooser
    • Readers' Choice 2007 Chooser
    • Tagger King
    • Virtually There: E3 2006 Sony Conference
    • Virtually There: E3 2006 Nintendo Conference
    • Virtually There: E3 2006 Microsoft Conference
    • Public Access
    • Tokyo Game Show 2006
    • MK Scream It Contest
    • After Hours: Virtually There
    • Burning Crusader
    • I voted
    • Virtually There: E3 2008 GameSpot Show Sushi
     
     

My Friends

All About jrclem

  • 19Jul 08

    Why So Serious?

    If you haven't already, go see The Dark Knight on an IMAX screen.

    It is absolutely worth it. There are actually a surprising number of scenes that were shot using IMAX cameras, and it is without a doubt the most immersive film I have ever seen.

    Heath Ledger is pretty much a lock for Best Supporting Actor at this year's Academy Awards. Granted, there are still about 6 months until Oscar season, but if you look at what's come and gone, and what's in the pipe, there isn't exactly a lot of competition. Not to mention that his portrayal of the Joker is absolutely amazing... I honestly couldn't have imagined a better version of the character if I tried.



    Go see it. And I hope you enjoy it as much as I did.
  • 5Jun 08

    Doing It Programmatically...

    always beats manual labor.

    So it's been a while since I've posted anything to the old GameSpot blog. But I thought now was a good of a time as any to try and jump back in with another mind-numbingly long soliloquy... When last we left our intrepid hero, he had started a new gig at an Internet marketing firm in the foothills of Appalachia. I'm happy to report that things have gone brilliantly these last 5 months - I've made some fast friends, and the job is a blast.

    I actually ran across a fairly interesting problem at work this afternoon. I needed to generate an XML sitemap for a site to be crawled by Google. Prior to today, I hadn't ever had a project that required this sort of thing. So I asked around, and basically I was told that people just recycled the same class over and over again, which required manually copying and pasting the urls into a function that would generate the xml. That just didn't seem like a great method to me. So I tried to come with something a little more flexible.

    Essentially, my thought was this - we already have this nice html sitemap on practically every site. So why couldn't I just use that file to generate the xml version? Well, unfortunately it isn't that straight-forward, because the html sitemap is actually using php to dynamically generate the links for data-driven content, and those links don't even exist until the page is loaded into a browser and the scripting is evaluated. After an hour or so of thought, I think I came up with a fairly elegant solution.

    Code now, description later...
    ob_start();

    $ch = curl_init(URL_BASE.'/'.$this->sitemapFile);
    curl_exec($ch);
    curl_close($ch);

    $response = ob_get_contents();
    ob_end_clean();

    $begin = strpos($response, $this->sitemapBegin)
    + strlen($this->sitemapBegin);

    $end = strpos($response, $this->sitemapEnd)
    - strlen($this->sitemapEnd);

    $response = substr($response, $begin, $end - $begin);

    preg_match_all('regexp for matching all html link tags',
    $response,$links,PREG_PATTERN_ORDER);

    foreach ($links[1] as $link) {
    test conditions for generating xml
    }
    So... I remember now how much I dislike using this editor, it cripples usage of quite a few html tags and keywords... Anyway, my solution initializes php's output buffering, uses curl to execute the page and generate the dynamic sitemap links (which are written to the buffer instead of the browser), saves the output buffer's contents to a string, and then cleans and closes the buffer.

    Next, I define the beginning and ending point of the sitemap. I made this decision because I figured that 99% of the time, the sitemap links will be inside of a div defining their sty|e (beginning point) and immediately followed by some other div like the page footer (ending point). Using this convention, I could strip out just the html containing the sitemap links and throw away the rest. Eg,
    ...blah,blah,blah
    [div id="sitemap"] (aka the beginning string)
    STUFF I NEED
    [/div]
    [div id="something_else"] (aka the ending string)
    blah,blah,blah...
    Finally, I find any matches to a regular expression defining the contents of href link tags and store them to an array. And the last step, and really the only one that should require modification in the future, is defining the cases that determine what sort of flags to use in the xml for each link. In this particular situation, there were 5 cases out of over 120 links.

    It might have taken a couple of hours of thought and coding time, but I think this algorithm will prove to be very reusable for subsequent xml sitemap generation, so long as the page conforms to the convention of surrounding the html/php sitemap links with unique html tags. At the very least, I know I am glad I spent my time trying to improve upon the status quo, and I hope it turns out that I've helped to save a lot of time in the future.
  • 19Jan 08

    Rearmed

    Sweet merciful crap! Hopefully coming to Steam...



    You can download the 720p version of this trailer from GameTrailers.

See Previous Blog Posts

My Recent Reviews

Recent Videos

  • Perfect Dark Source Villa 2

    Watch this video

    A second look at the "Villa" map from the HL2 mod Perfect Dark: Source - showing off the map's design and the inclusion of HDR lighting.

    • Posted Dec 24, 2006 9:09 pm PT
    • 1091 Views
    • 2 Comments
  • Get A Life - Trailer

    Watch this video

    A brief gameplay trailer of the upcoming single-player Half-Life 2 mod Get A Life. For more information on this or any other HL2 mod, be sure to visit the HeadCrab Union (HCUnion.com).

    • Posted Oct 16, 2006 2:37 pm PT
    • 422 Views
    • 1 Comment
  • Incoming: Source Combat Trailer

    Watch this video

    The developers of the Half-Life 2 modification Incoming: Source present an in-game trailer of action from the multi-player component. For more information on this or any other HL2 mod, be sure to visit the HeadCrab Union.

    • Posted Oct 16, 2006 12:34 pm PT
    • 1039 Views
    • 2 Comments

jrclem's Feed

  • Jul 19, 2008 11:20 pm PT
    jrclem posted a new blog entry entitled Why So Serious?
advertisement

My Unions