adsense

Since I was doing a bunch of other stuff on the blog anyway, I decided to go ahead and sign up to put AdSense on my blog.  I don’t expect to make any money off it, but I was curious about it, so I thought I’d give it a try.  There was some weirdness going on at first, but I’ve figured out what was causing it — Adblock Plus.  Duh.  The AdSense page at Google is pretty much nonfunctional if you’ve got ABP installed and enabled in Firefox.  And, of course, it blocks the ads that are being put on my page, so  I can’t see them.  Oops.  I disabled it, and now I can access the AdSense site, and I can see the little ads Google is putting on my page.  By default, the ads were appearing at the top of the page, above the blog posts, so that was kind of ugly.  I moved the code to the bottom of the page, so the ads will appear down there now.

Fragile Things, again

I posted a couple of days ago that Neil Gaiman’s Fragile Things had just been released as a $7.99 mass market paperback, but still cost $9.59 for the Kindle.  I just looked again, and now it’s $7.99 for the Kindle, so I guess somebody (or some automated process) does keep an eye on these things and adjust Kindle prices downward when a cheaper hard-copy version of a book is released.
Oh, and I just noticed that Interworld is only $3.99 for the Kindle.  I already have the hardcover on that one, but if you like Gaiman and haven’t read it, it’s a good book.  (Not great, but fun, and a quick read.)

still messing around with my tag cloud

OK, I’m still messing around with my tag cloud code. As previously mentioned, I took a bit of code from this page, and have been messing around with it. I just added a couple of minor things that I wanted.
First, I now have a [Home] link at the end of the tag cloud, if we’re not actually on the home page. Second, I now change the link into just text if we’re on the page for a given label. None of this was a big deal, but it did serve to remind me of a few JavaScript basics, such as how to do RegEx matching in JavaScript, and how to get the URL of the current page. Here’s the code:


<!– originally taken from http://phydeaux3.blogspot.com/2007/05/automatic-list-of-labels-for-classic.html –>
<div id="labelList" class="BlogBody"></div> <script type="text/javascript">
//<![CDATA[
function listLabels(root){
var baseURL = '/search/label/';
var baseHeading = "My Tags";
var isFTP = false;
var llDiv = document.getElementById('labelList');
var entry = root.entry;
var h1 = document.createElement('h1');
h1.className = 'sidebar-title';
var h1t = document.createTextNode(baseHeading);
h1.appendChild(h1t);
llDiv.appendChild(h1);
var ul = document.createElement('not-ul');
ul.id = 'label-list';
var category = entry.category;
labelSort = new Array();
for(p in category){
labelSort[labelSort.length] = [category[p].term];
}
labelSort.sort(function(x,y){
var a = String(x).toUpperCase();
var b = String(y).toUpperCase();
if (a > b)
return 1
if (a < b)
return -1
return 0;
}); // http://www.java2s.com/Code/JavaScript/Language-Basics/CaseInsensitiveComparisonfortheArraySortMethod.htm
// where are we?
var pageaddr = document.location.href;
for (var r=0; r < labelSort.length; r++){
var li = document.createElement('not-li');
var full_link = baseURL + encodeURIComponent(labelSort[r]);
var re = new RegExp(full_link + '$');
if (pageaddr.match(re))
{
// just show the text
abnk = document.createTextNode(labelSort[r] + ' / ');
ul.appendChild(abnk);
}
else
{
// show the link
var a = document.createElement('a');
if(isFTP){
a.href = full_link +'.html';
}
else {
a.href = full_link;
}
a.innerHTML = labelSort[r] + ' ';
li.appendChild(a);
ul.appendChild(li);
abnk = document.createTextNode(' / ');
ul.appendChild(abnk);
}
}
// add a home link.
if (pageaddr != "<$BlogURL$>")
{
var li = document.createElement('not-li');
var a = document.createElement('a');
a.href = "<$BlogURL$>";
a.innerHTML = '[Home]';
li.appendChild(a);
ul.appendChild(li);
}
llDiv.appendChild(ul);
}
//]]>
</script>
<script type="text/javascript" src="http://www.blogger.com/feeds/13487006926024246136/blogs/3059692?alt=json-in-script&callback=listLabels" ></script>

Snow on main st


Snow on main st
Originally uploaded by andyhuey

It’s a good day to be working from home… Here’s the view outside my window right now. When I took a walk outside to see if I could get something for lunch, nearly all the stores on Main St were closed.
Here a link to a photoset with a couple more pictures I took from my window.
Oh, and not to get all maudlin again, but a couple of times today I’ve thought about picking up the phone and calling my Dad, to see how much snow they’re getting down in Whiting. Then, I remember that there’s just an empty house down there now. (*And* that I’ll probably need to shovel out the driveway and walk when I go down there this weekend to pick up Mom’s will and some other papers.)

more custom domain stuff

OK, I’ve decided that I’m close enough to good that I can officially switch to the custom domain thing.  From now on, http://blog.andrewhuey.com/ will be my official blog and http://andrewhuey.org/ will just stick around in case there are links to old posts from other sites.  I’ve gone ahead and replaced the code in one of my SSI files with a pointer to the new location, so hopefully that will get people over here.

switching to a custom domain

So I went ahead and started switching my blog over to a custom domain last night. I can’t say that I’m 100% happy with how things are working, but I think I’m off to an OK start, and I’ll stick with this for awhile. Just to document a few things, for future reference, or for anyone else messing around with this, here are a few good links and notes:

First, here is a good post on how to move from FTP to a custom domain. I started off by reading this post and following some of his advice. (Right now, by the way, andrewhuey.org will still bring up the old blog. blog.andrewhuey.com will bring up the new blog. I’ll have to make some DNS changes at some point to get everything pointing to the new blog.)

I couldn’t quite figure out if I should switch to a new template, or try to stick with my old one. In the end, I decided to stick with the old template, but make some necessary changes to it.  I was using server-side includes in my old template.  I can’t use those anymore, as far as I can tell.  I’m not actually publishing .shtml files to the server anymore, so Apache can’t do the includes, and Google doesn’t seem to support anything similar within a Blogger template.  (I think they could easily create a command that you could use in your template to do this kind of thing, but I haven’t found any indication that there is one.)  When I think about it, though, the main reason I was using the SSIs was so that I wouldn’t have to republish my entire blog any time I made changes to certain aspects of my template.  By moving certain HTML out of the template into separate HTML files on the server, I would always be showing the current content on any page, regardless of whether or not it had been regenerated recently.  That’s no longer an issue, so now I can just pull that code back into the template, since the pages are (I guess) generated on the fly every time now.

I was using a PHP script to generate a tag cloud on my old blog.  This was actually looking at files in the labels/ folder, which won’t exist anymore, so I had to come up with a new way to do that.  If I switched to the new template style, I could just drop a tag cloud widget on the page, and be done with it.  Since I’m sticking with the old template style, I had to find another way.  This post shows a great way of generating a tag cloud using JavaScript and JSON.  It’s pretty cool.  I’m now using a modified version of that script.  I only changed a few things.  One minor thing is that I wanted a case-insensitive sort, so I added code I found here to do that.  And I changed the output from an unnumbered list to just a stream of text, separated by slashes, like my old tag cloud.

I think the whole thing looks pretty good at this point, though I’ve removed some stuff that I want to add back in at some point.

Fragile Things

I noticed today that Neil Gaiman’s Fragile Things is now available as a mass-market paperback.  I’ve never gotten around to picking this up previously, so I went over to Amazon and took a look.  The new paperback is $7.99.  There’s a Kindle edition for $9.59.  And, strangely, there are six Selections from Fragile Things Kindle e-books for 99 cents each.  I think that those contain the entire contents of the book, when you put them all together, but I’m not sure.  I wonder what the thinking on that was.  I probably think about these things too much.

Blogger FTP support going away

One very minor thing that’s come up recently: Support for FTP publishing in Blogger is going away. Apparently, less than 1% of Blogger users publish via FTP. That’s the method I’ve been using from the start, and I’ve just never changed. So now I’m going to have to. They’re supposed to be releasing a conversion tool that will make it easy to switch to a Google Custom Domain, so I can keep the blog at andrewhuey.org, but I might have to do some finagling to redirect andrewhuey.org to blog.andrewhuey.org or something like that.

On a practical basis, it shouldn’t be a big deal. On a philosophical basis, though, I’m wondering if I want to do this. Right now, all my content is stored at Google, of course, but published as HTML files under my 1&1 account. I can back them up easily, and if I ever decide to stop using Blogger, they don’t go away — I can keep my archives right where they are. If I switch to “custom domain” publishing, then my fqdn (say, blog.andrewhuey.org) will just point to Google’s servers, and I need to rely on them to serve up the content. They *do* have export tools that can supposedly give me a snapshot of my entire blog, so I could then import it elsewhere, so maybe there’s no practical problem with this. It just bothers me a bit that all my content will be in a database at Google and not fully under my control.

I may switch to WordPress. My host, 1&1, has the necessary support for WordPress (basically, PHP and MySQL), so I can install that, and have my blog completely under my control. All the data will be in a MySQL database that I can back up whenever I want, the logic will all be running on my own site, and I can pick it up and move it to another host whenever I want. And I guess another nice philosophical point is that WordPress is open source, so it won’t matter if WordPress as a company goes away; I’ll still have the code, running on my own site.

Of course, with everything that’s going on right now, I’ll probably just take the path of least resistance and go with the Google “custom domain” thing.