Archive for February, 2008 Page 2 of 8

metaWeblog API : metaWeblog.newPost

Recently I was trying to figure out a way to automatically publish a summary of the preceding week’s C:SI statistics to this blog, similar to how some of the other Second Life® blogs publish traffic or signup or economic statistics, and being a WordPress user I thought it made sense to use XMLRPC and the metaWeblog API to accomplish this. 

Using this API would allow me to programmatically post anything I wanted via a cron job, and seemed cleaner and less fragile than attempting to insert posts directly into the database.

Unfortunately, it was very difficult to find good code and information that did precisely what I wanted.  The most frequently referred-to code for doing so just flat-out didn’t work and was not at all documented, but it was far and away the most frequently quoted sample on Google.

I finally managed to find decent enough documentation on Six Apart on what the various metaWeblog methods were expecting for input, and somewhere (I cannot remember now out of dozens of pages visited) I found  the following snippet which is pretty lightweight and works perfectly for my needs.

I know it’s an off-topic post for what this blog is usually about, but I wanted to make sure that there was at least one more place on Google where someone with needs as simple as mine could find a snippet of PHP code to very easily post to a WordPress blog (or any other blog that supports metaWeblog API, there are several).

PHP Code:

//requires xmlrpc.inc from http://phpxmlrpc.sourceforge.net/
require_once(’xmlrpc.inc’);

$g_blog_url = "http://path.to.blog/xmlrpc.php";
$g_id = "username";
$g_passwd = "password";

$GLOBALS[’xmlrpc_internalencoding’] = ‘UTF-8′;

// http://www.sixapart.com/developers/xmlrpc/metaweblog_api/metaweblognewpost.html
function metaWeblog_newPost( $blogid, $title, $content, $tags="", $category="" )
{
    global $g_id;
    global $g_passwd;
    global $g_blog_url;

    $client = new xmlrpc_client( "{$g_blog_url}");
    $f = new xmlrpcmsg("metaWeblog.newPost",
        array(
            new xmlrpcval( "{$blogid}", "string"), // BlogID (Ignored)
            new xmlrpcval( $g_id, "string"), // User
            new xmlrpcval( $g_passwd, "string"),    // Pass
            new xmlrpcval( // body
            array(
                ‘title’ => new xmlrpcval($title, "base64"),
                ‘description’ => new xmlrpcval($content, "base64"),
                ‘category’ => new xmlrpcval($category, "base64"),
                ‘mt_keywords’ => new xmlrpcval($tags, "base64"),
            ), "struct"),
            new xmlrpcval(true, "boolean") // publish
        )
    );

    $f->request_charset_encoding = ‘UTF-8′;
    $response = $client->send($f);

    return $response;

}

Popularity: 49% [?]

Jack Thompson Parody Video

I read the Game Politics blog, which this morning featured an absolutely awesome video about Jack Thompson that I just *HAD* to share :)

If you don’t know who Jack Thompson is, you can think of him a bit like the Prokofy Neva of the legal world.  He’s such a deluded, self-righteous, crazy, busybody pain in the ass that the Florida Supreme Court had to bar him from filing motions with the court.

Anyhow, even if you don’t know who he is the video should still be kind of funny, it’s just funnier if you do :)

 

Popularity: 38% [?]

Virtual Worlds for Business - IBM creates OpenSIM Data Center

Virtual World News had an article a couple of days ago on IBM’s announcement that they had built a 3D data center simulation using OpenSim, which I found particularly fascinating because I have long believed that the potential of Virtual Worlds like Second Life® and OpenSimulator was far larger and with potential for much broader application than what we are currently seeing.  Take, for instance, this comment by an IBM researcher on the topic:

"Viewing information about your data center in 2-D text — even in real time — only tells a data center manager part of the story, because our brains are wired for sight and sound," said IBM Researcher Michael Osias, who architected the 3-D data center service. "By actually seeing the operations of your data center in 3-D, even down to flames showing hotspots and visualizations of the utilization of servers allows for a clearer understanding of the enterprise resources, better informed decision-making and a higher level of interaction and collaboration."

Visualization is extremely important, and the ability of virtual worlds to enhance visualization and make use of our visual/spatial processing abilities (using the concept of space as a memory cue and productivity enhancer) is absolutely fascinating and intuitive.  We are quite simply built to work in a 3D world with maximum effectiveness, and evidence suggests that people have been formally taking advantage of this astounding ability since before 85 BC.  IBM obviously believes that this has practical business application, and while some may question whether there is truly any practical benefit to using virtual worlds in this way, I strongly believe that we will discover over time that it’s one of the most powerful and effective uses of the technology - for business or otherwise.

I remember back in high school more than a decade ago, while reading a book about computer graphics programming in class one day I came across a quote (likely only half-remembered now) that really struck me powerfully : "Computers may be great at business and calculations, but graphics is what they are for".  I doubt that the author of that book (it may have been Michael Abrash, I cannot recall after so much time) could have envisioned how powerful commodity graphics and general-purpose computing hardware would become in less than 20 years from the time he wrote that, but I’m willing to bet that he’d feel similarly about 3D technology and virtual worlds : It’s what computers are for.  How exciting to be able to use a system like loci by actually building our own 3D representations, and then to use that representation to manage extremely complex real-world systems that are difficult to truly understand in a flat printout or 2D program.

Popularity: 60% [?]

Silly things people search for on Google

I’ve been INSANELY busy these last two days, and haven’t been able to make it in-world for any substantial amount of time, so tonight I thought I’d slow down a little and take a peek at my Google Analytics numbers for this site while I was eating dinner.

Google Analytics is freaking awesome if you own a website, even if it *is* geared more toward those who are attempting to make money via advertising.  Among the useful features it includes is a way to clearly see which search engine phrases are bringing people to your site, I suppose under the theory that if you know what works you can maximize it.

Now, there’s always a few queries listed that get chuckles out of me, but some are just downright amazing; I think to myself "How the hell did that phrase bring someone to my site?!?!".  For example, one of the search queries was "catch mono tomorrow", and I’m still curious how my site came up in that search.

 

And then there’s this:

cheatCSI

 

Of all the places for someone to find information about how to cheat in C:SI, they clicked on my site.

That was a pretty good chuckle :)

Popularity: 42% [?]



Bad Behavior has blocked 107 access attempts in the last 7 days.

Close
E-mail It