I'm posting this because I often find myself sitting at my computer thinking either, "There's nothing to do, I think I'll just write a blog post." or "There are a whole ton of things I should be doing now but I just can't be bothered. I think I'll do a blog post." and end up sitting, staring at my Admin Panel for minutes on end, trying to think up a good idea for a blog post.

If this happens to you too, why not try out this out?<!--more-->

  1. First things first. Open up that Admin Panel, get to your Blog-Post-Writing-Station. If you don't even bother going to your panel, you won't have the motivation to write a post.
  2. Don't try to write the post's title first. I've made that mistake many a time, and it's much easier writing a title after there's some content for you to title.
  3. Think, what is my blog about? Why do people want to read my blog? What can I offer them that no one else can? People come to your blog because they want something. What is it? Laughter? Debates? Tutorials? Build on that.
  4. Does your blog have a theme? Or is it just random nonsense? If your blog is random nonsense it's a little harder to find something to post about, but don't worry. The blogger always prevails.
  5. What interests you? You're blog is your vent, talk about what you like on it. (However, remember that blogs and the internet in general is not really a place to talk about inappropriate things such as creation of children)
  6. Go read your favorite blogs and see what makes them so good. Any content of theirs that you can build upon? (And Pingback them for? 8D)
  7. If all else fails, a 101 posting ideas list never fails to amaze. Try it out, you may be surprised of what you haven't thought of yet.
  8. From the same place as the 101 posting ideas, we have the Visitor Grid, another great way to come up with ideas for your blog

I hope that I've just fulfilled the reason I posted this in the first place: To write a good post.

Hatkirby on June 19th, 2008 at 10:30:03pm
πŸ‘ 0 πŸ‘Ž

This is an age-old PHP argument: Is using $_REQUEST dangerous?

For those not in the know, $REQUEST is a combination of $COOKIE, $POST and $GET. If you try to access $REQUEST['para'], it will first attempt to retrieve $COOKIE['para'], then $POST['para'] and finally $GET['para']. This has led many people to believe that $_REQUEST is very dangerous to use because cookies can be easily edited by the client. However, this is not so.

Cookies can be easily edited by the client, true. But so can query strings ($GET) and the Request Body ($POST). $_REQUEST requires the same amount of XSS-proofing as the others do.

The only problem I see with $REQUEST is that using it doesn't specify whether you are using $COOKIE, $GET or $POST. It would be too ambiguous for me and that's why I leave it be.

Hatkirby on June 18th, 2008 at 10:30:07pm
πŸ‘ 2 πŸ‘Ž

Recently, I read an article on ProBlogger about the difference(s) between Twitter and Plurk.

I started using Twitter about a year ago, and stopped a few months ago, because it was boring me. However, when I read that above article, I had to have a try at Plurk.

Plurk is already a whole lot more fun than Twitter. As the article on ProBlogger shows, Plurk runs more like a fourm. You Plurk something, and people can Plurk replies to it which show when you click on the original Plurk. You can also see people you've friended's Plurks on your timeline.

With Twitter, the only way for people to reply to tweets are for them to send you a private tweet that A: Doesn't have any connection to the original tweet, and B: Only you can see it.

Because of this, I've decided I like Plurk. I've been using it recently, and as I've said above, it's fun. Have a look at it. Why not even sign up and give me a plurk? Come on, it'll be fun. Please?

Hatkirby on June 17th, 2008 at 10:30:04pm
πŸ‘ 5 πŸ‘Ž

....because it drove me insane when I was writing the new Four Island. There didn't appear to be any information on it anywhere. Or at least, any complete information.

Finally, however, I found the Pingback Specification, which, at the bottom of the page, includes a nice little step-through of Pingback at work.

To summarize, there are two parts of the Pingback process. The server and the client. The client sends Pingbacks and the server receives them.

When writing a blog post, the client should scan it for external links and, if any are found, attempt to read the pages they link to. If they contain a <LINK REL="pingback" HREF="...."> tag, then that means that the page in question supports pingback. So, if one is found, the client uses XML-RPC to connect to the server URL specified in the HREF attribute of the tag mentioned above. Then, it calls the method pingback.ping with two parameters, the first being the URL of the local post, the second being the URL of the post being linked to. From there, it's the server's job.

When the server receives the Pingback, it checks to see the both URLs actually exist and that the linking blog post actually links to the second URL. If it does, the server adds a comment to the blog post in question saying that it's been linked to and providing a link to the linking blog post.

Ok, that probably sounded complicated. It is, a little. So, that's why we're going to do this step by step, starting with the client. Let's examine the specification process again:

  1. First, the client scans the post being submitted for external links.

We can accomplish this with a simple screen scraper which is a script that combs through an HTML page and picks up useful information. We'll be using a simple one to pick up all of the links, and then to sift out the ones that aren't external: (Note that I am assuming that the contents of the post are located in $postText)

preg_match_all('|<a\s[^>]*href="([^"]+)"|i',
        $postText,
        $matches);

foreach ($matches[1] as $link)
{
  if ($all_links[$link])
  {
    continue;
  }

  $all_links[$link] = true;

  if (preg_match('/^https{0,1}:/i', $link))
  {
    // We've got an external link!
  }
}
  1. Then, the client attempts to download any links it finds.

This is easy as well. For this I'll be using cURL. Note that this code goes in place of the comment // We've got an external link!.

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $link);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_HEADER, false);
$page_data = curl_exec($c);
curl_close($c);
  1. If they contain a <LINK REL="pingback" HREF="...."> tag, then that means that the page in question supports pingback.

Checking for the tag is again, easy. We do it with a simple regular expression:

if (preg_match('/<LINK REL="pingback" HREF="([^"]+)">/i',
        $page_data,
        $server))
{
  // It has the <LINK> tag!
}
  1. Finally, the client sends an XML-RPC request to the server located in the tag.

For this, we need XML-RPC for PHP. It's a very easy to use XML-RPC library. Somewhere in your page, you need to include it's client libraries (in lib/xmlrpc.inc). When that's done, we have our client-side Pingback code:

$client = new xmlrpc_client($server[1]);
$msg = new xmlrpcmsg("pingback.ping", array(
        new xmlrpcval(PERMALINK, 'string'),
        new xmlrpcval($link, 'string')));
$client->send($msg);

Make sure to replace PERMALINK with some method of generating the URL of the current post.

That's the client-side part of Pingback, the sending side. Now for the server side.

Before we begin, we have to remember that the client finds the server by looking for a tag in the blog post's page header. You should include this now into your global header file:

<LINK REL="pingback" HREF="http://yourdomain.com/xmlrpc.php">

Now it's time to make that xmlrpc.php.

  1. The server has to be able to receive XML-RPC requests. Because of this, it needs to include XML-RPC for PHP's server-side library (lib/xmlrpcs.inc) as well as the client-side. Then, it needs to define the pingback.ping method.
$s = new xmlrpc_server(array(
        "pingback.ping" => array("function" => "ping")));

function ping($xmlrpcmsg)
{

}
  1. The server then needs to verify that both URLs actually exist.

How to implement this part is up to you as I'm not writing your entire blog, but the code to extract the URLs passed as arguments to the pingback.ping method is as follows:

$from = $xmlrpcmsg->getParam(0)->scalarVal();
$to = $xmlrpcmsg->getParam(1)->scalarVal();
  1. Finally, the server posts a comment to the blog post in question notifying people that someone has sent it a pingback.

Once again, this is mostly up to you as I don't know the specifics of your blog. However, when the comment has been successfully added, the XML-RPC server needs to return with a response to the client:

return new xmlrpcresp(new xmlrpcval(
        "YAY! Your Pingback has been registered!", "string"));

YAY! You're Pingback implementation is nearly done! There's only a little bit left now. With the server, it has to response with an appropriate error if there's some problem such as the source URL not existing. Here's a list of them:

  • From doesn't actually link to To:
return new xmlrpcresp(0, 17,
        "Source uri does have link to target uri");
  • To URL doesn't exist:
return new xmlrpcresp(0, 32,
        "Target uri does not exist");
  • To URL doesn't support pingback:
return new xmlrpcresp(0, 33,
        "Target uri cannot be used as target");

I really hope someone finds this tutorial useful because when I wanted to implement Pingback support on my blog, as I said before, it was very difficult to find any good information about it.

EDIT: Wow. One of the most popular posts on the site and it was posted, of all days, June 17th. Very strange.

Hatkirby on June 16th, 2008 at 10:30:02pm
πŸ‘ 5 πŸ‘Ž

Two days ago, I found out about a movie called "The Number 23". It's a movie about the 23 Enigma, the belief that everything adds up to, in some way, the number 23.

Now, this being Four Island, it's quite obvious that I wouldn't believe such a thing. I'm more likely to believe that everything is four, and let's face it, it's true.

But, I can be very paranoid. FACT: I took the battery and SIM card out of my phone before watching the trailer for The Ring. So, being paranoid as usual, I decided to add up the time of my birth. 4:06 PM. (Yes, I know, I was born at FOUR o'clock, and I'm very proud of that fact) Obviously, 4 and 6 doesn't equal 23. But.... this is 12-hour time. What about 24 hour time?

16:06

Added together, 22.

Ok, it may not be 23, but think. You may recognize that number from elsewhere on Four Island. Yes, April 22nd is Trider's CIEday, and Four Island was created on September 22nd.

Coincidence? Yes, I think so. But still, the senseless paranoia is fun. And as an added 23-tidbit, look at the post I linked to earlier in this post about everything being Four. It may be Four-centered, but look at the publish date. That's right, January 23rd.

EDIT: After closely examining the Everything is Four post, I realized another snippet of apophenia. The time that the post was published. The digits add up to 22.

Hatkirby on June 15th, 2008 at 10:30:03pm
πŸ‘ 1 πŸ‘Ž

Well, in all of my random spare time, I've come up with a random Related Posts game. Random.

Want to know how to play? Of course you do.

  1. First, go to the newest Four Island post
  2. Check to see if there any related posts. If there aren't, go to the next most recent post.
  3. Once you've gotten a starting post, the game starts. Every chooses a related post.
  4. On the related post, check to see if there are any related posts that you haven't been to already. If there aren't, the game ends for you. If there are, you get one point.
  5. Choose a related post that you haven't been to already
  6. Repeat steps 4-5 until the game is over for you.

Once the game ends for everyone, the person with the most points wins.

Like it? Think it's completely random? Well, that's what you get. I'm INSANE about the new Four Island.

Also, as a sidenote, I've modified the way that Pingbacks display here on Four Island. Instead of saying:

Someone has posted a link to this post on URL

Pingback

It will say:

URL

EXCERPT OF LINKING POST

Pingback

This makes much more sense, I believe. I'm still open to any Pingbacks! Remember, the test Pingback is still going, so continue to Pingback The New Four Island!

And, another sidenote, I've added a Top Commenters to the sidebar so you can see those commenters who are really.... commenty. However, it is a little disheartening to see me with 84 comments, and the next person down with 14 comments. That's a BIIIIIIIIG difference, and one that I hope will shrink. Pwease?

EDIT: Remember the downtime I talked about yesterday? Well, you can forget about it. Maybe. I don't know, but it seems a possibility that it'll be avoided. Just wait until tomorrow to see.

EDIT: Remember, feel free to play the Related Posts Game and posts your results here. I'd be happy to play anytime as long as someone else does.

Hatkirby on June 14th, 2008 at 10:30:05pm
πŸ‘ 8 πŸ‘Ž

We Love KFM!

Wow! People apparently really like KFM! And I never knew! Well, I kind of guessed in Hello KFM, but.... wow.... Anyways, here are the results:

Yes - 7 vote(s)! No - 0 vote(s)! Huh? - 1 vote(s)! Indifferent - 3 vote(s)!

I think I may try to bring KFM back. I mean, I like that comic a lot. It's quite a lot of fun. And I don't think I deleted the original comics, they're still here on my computer, just not available to the world. The only problem I have is with motivation. I procrastinate way too much. I need to find out a way to get around the procrastination problem. Ideas? Please comment.

In other news, there's going to be some scheduled downtime on Monday. It should start around 7 o'clock AM and end around 4 o'clock PM. Sorry about this disruption, I know, Four Island downtimes makes people sad.

EDIT: Oh. My. Goodness. I just checked the referential ID for this post. This post.... it's the 100th post on Four Island!

YAY for the 100th post! 10 months of writing posts for Four Island has wielded this great result. (Though I only started recently writing a post a day) Thanks to all who read Four Island! And right now, that number is.... oh giant hairy balls of poop. I forgot to add the hitcounter to the new Four Island! Oh, I'll go fix that now!

Hatkirby on June 13th, 2008 at 3:24:07pm
πŸ‘ 1 πŸ‘Ž

Finally. It's finally here. The new Four Island....

Well everyone, I hope you enjoy the new Four Island! It was quite a lot of work to put together! How about I start by enumerating the new features?

The blog has many new Wordpress-esque features even though it isn't Wordpress. I've written a Related Posts module that searches for other posts that could possibly be related and shows you the top 5. There's a Popular Posts module that gives each post a Popularity score that can be increased by reading it, commenting on it, and most importantly, giving it pingbacks.<!--more-->

Speaking of Pingbacks, yes! The Pingback support is finally here! And, peoples, just to test out this newfound Pingback support, I would appreciate it if someone Pingbacked this post. You know, add a link to this post in a post on your blog. Thanks in advance to anyone who does this!

Another great new feature. Anonymous commenting has finally been re-enabled! But, rather like Wordpress, you must have your comment moderated before it can appear. But after you've had one comment moderated, any others using your same Anonymous Username and Email will automatically appear.

The Popular Posts module has also added a Thumbs-Up Thumbs-Down method of rating a post. This way, you can support the post without writing a comment. However, a post won't get as many popularity points from rating than commenting, and it is possible to negatively rate a post.

One of my favorite new features (though I don't quite know why) is the usage of slugs. No you lollipop licker, I'm not talking about slimy little molluscs, I'm talking about the method of writing pathnames. Let me elaborate. If I had a blog post called.... say.... "The New Four Island". The equivalent slug would be "the-new-four-island". And thus, it's path would be: "http://www.fourisland.com/blog/the-new-four-island/". It's a newer (and better) method of naming paths than URLEncoding them as the old Four Island did.

That gets me onto the Wiki. The Wiki system has been completely rewritten. And guess what, it uses slugs as well. It also has Page History support so if there are bad people doing bad things, an admin can go look at the past and revert.

Also, while I've written the new Wiki, I haven't moved the old Wiki to the new Wiki. I'd like some people to help me do so. I'll release a link to the new Wiki in a couple of posts, kay?

Fourm time. Well, the Fourm is muchly the same as ever, but due to being included in a strange fashion, the Fourm has a couple of bugs now that I'd like to resolve. First of all, when logging in, registering or searching, the page looks really hideous and has other information at the bottom. Another thing, clicking on the "Fourm" button at the top logs you out. Please stand by these errors while I try to resolve them, kay?

The Poll is pretty much the same, except for the new rendering model that has gripped nearly all of Four Island. Using the beautiful CSS-Bubbles located at http://www.willmayo.com/2007/02/10/css-speech-bubbles/ (hey look, I've sent a Pingback!), I've redesigned most of Four Island to include them. Just look at the RightBar, the blog, the blog comments, the Poll Archive. They look prettyful, and you know it.

The Quotes DB has been completely re-written so that it isn't Rash anymore, now it's completely my own code. Also, I've added a convenience method. If you are logged in while contributing a quote, you don't have to get it moderated.

Something you may have noticed. Look at the date if you haven't. Anyways, if you are superstitious, you may be thinking "What's Hatkirby doing, releasing the new Four Island on Friday the 13th?" Well, to answer that, for some reason Friday the 13ths have normally actually been more lucky for me than unlucky. Strange, but true.

Goodness, this has been a loooooong post. Well, anyways, I hope you enjoy the new Four Island! I'm so excited for it, and besides, it was a whole ton of work completely re-writing Four Island!

EDIT: Wow, it turns out that all of the problems with the Fourm have been resolved before I'd even had the chance to examine them. I think that they probably had something to do with the test subdomain I was using to test the new Four Island.

Hatkirby on June 12th, 2008 at 5:35:41pm
πŸ‘ 0 πŸ‘Ž

SimpleBlog

A few days ago (my birthday, as a matter of fact), I wrote some blogging software for Smiley. He's using it for his website The S Site. But that got me thinking.... If I'm going to be writing projects and codes and stuffs, why not write a PHP blogging system for other peoples to use? I don't want to release Four Island's blogging software, that's MINE. But, SimpleBlog I can.

When the new Four Island's done, I'm going to start a new project called SimpleBlog, which will be the blogging software that Smiley is currently using. But I'm going to have to enhance it. Trust me, just ask Smiley about the Admin Panel. 8D

EDIT: This project has been created. It's called simpleblog.

Hatkirby on June 11th, 2008 at 10:30:03pm
πŸ‘ 2 πŸ‘Ž

I have a short question post here: What is Slashdot? More importantly, what's so good about it? People apparently flock to it like flies to a supernova, but I can't see what's so good about it. If anyone could elaborate, I'd be much gratified.

There's my short question post. I may have more of these in the future. If you know the answer, comment. If you don't have an account, post on the Fourm or email me.

About that. On the new Four Island, I'm writing a moderation module that allows you to comment even if you aren't logged in, but if you aren't, the comment has to pass through moderation.

Speaking of the new Four Island, I have an update on it's production. Sorry, it defiantly won't be out until at least Friday. I finished the Wiki yesterday, but today I have some work I need to do, and even if I do the entire Admin Panel tomorrow, I won't be able to release it until the next day. Sorry about that.

Also, while I'm asking questions, here's a second one: When the poop is the Internet Archive going to archive me?

Hatkirby on June 10th, 2008 at 10:30:47pm
πŸ‘ -1 πŸ‘Ž