« March 2006 | Main | May 2006 »

Hacking MySpace

April 20, 2006

Mike Davidson, you are officially the man. Or as Scrivs exclaimed in the first comment on Mike’s latest post, Hacking A More Tasteful MySpace, “You are a god amongst teenagers”! Where most self-proclaimed web professionals are squeamish about the very idea of creating a MySpace account, Mike saw it as a design challenge and produced one of the best MySpace profile page I’ve ever seen, along with a great tutorial: http://www.myspace.com/mikeindustries. I plan to jump head first into Mike’s tutorial soon, posting my experiences here, but for now here are a few other nice custom MySpace profiles.

Update: I recently wrote a post about hosting MySpace profile images so that nobody else can use them on their profile. Most profile images on MySpace are not actually hosted on MySpace, but rather on other private servers. This is known as hotlinking, but what if you wanted to allow your profile to hotlink images from your server but not other people’s profiles. This is essentially what I’ve figured out how to do using PHP. It prevents other people from using your MySpace images and stealing your bandwidth. Check it out.

Conditional Advertising

April 19, 2006

I have entered the dark side. I now serve Google Adsense ads on my site. :) I mentioned this idea last week and that I only wanted to serve contextual ads, and only to the 87% of people who were visiting my site via search engine referral. As it turns out, conditionally serving ads wasn’t very hard at all. I woke up early on Saturday and before my wife woke up, I had it all working.

To keep the code simple I determined whether or not someone was coming from a search enging by checking for “q=” or “p=” in their referring url. MOST search engines use one of these 2 variable names in their query string for the search terms.

Here’s how I set it up in PHP with Movable Type:
  1. Check for “q=” or “p=” in the referer and set a variable in the header include. Simplified PHP: Thanks Ryan.
    //Should we show Google Ads?
    $referer = $_SERVER["HTTP_REFERER"];
    $showads = preg_match("/[qp]=/i", $referer) > 0;
    
  2. Edit my MT Individual Entry Archive template to insert a “large rectangle” ad unit between every 15th comment in the comment loop.
    <?php if ($showads && <MTCommentOrderNumber> % 15 == 0){ ?>
    <script type="text/javasctipt>...</script>
    <?php } ?>
    
  3. Place another “skyscraper” ad unit in my sidebar.
    <?php if ($showads){ ?>
    <script type="text/javasctipt>...</script>
    <?php } ?>
    

That’s it. Pretty simple really. Google only allows you to display 3 ad units per page, but they control that themselves. So, even if you have 20 javascript ad sense requests on a page, Google will only render the first 3. So on pages that have over 45 comments, there will be ads below the 15th, 30th, and 45th comment and that’s it. On pages that have less than 15 comments, only the sidebar ad will show up.

Example of page with only comment ads:
Google “Popcorn Ceiling Removal” and click on my page.

Example of page with only sidebar ad:
Blingo Search “win at blingo” and click on my page.

I read through the AdSense Terms & Conditions and this type of conditional display of AdSense for Content blocks doesn’t seem to violate any rules. If anyone finds out somehow that it does, please let me know. I would recommend this technique to anyone who gets a lot of search engine traffic to specific posts on their personal site. I don’t think it’ll help you build your adsense empire (LOL), but I’ve been making a few bucks a day since I set it up.

Blogging For Profit?

April 14, 2006

When it comes to making money from my personal site, I generally shy away from the idea. I’ve been a banner-ad/popup/sidebar-ad hater since I first started using the web, so why would I EVER want to put such them on my own site. Well, for one, I’m curious. I’d like to know what the payout is on these things. While you’ll NEVER see a girating pig with state abbreviations on my site begging you to refinance now (who clicks on that crap?), I’ve thought a few times about adding Yahoo or Google ads that might be relevant to the content of a particular post.

How Not to Annoy Your Regulars

Personally, I don’t find Google AdSense style ads that annoying. Sometimes I even click through them if one of the links look interesting, but they usually blend into the site so well that I look right past them. However, I still don’t think bloggers should ever present ads to their regular users. Who is left, you ask? Search engine visitors. According to Google Analytics, over 87% of my visitors are first timers:

profit-pacman.jpg

According to Mint (Yes, I’m a stats junkie…) Most of those people are coming in via searches for random things like popcorn ceiling, publix sushi, and my favorite, the blingo search for I want to win at blingo. Somehow I get top-ten plus search engine rankings for a lot of really random keywords.

While I don’t want to serve ads to anyone who reads my rss feed, or visits the site via links from my friends sites, I don’t feel bad about serving relevant text ads to the throngs of people who want to ask me all kinds of silly questions about getting rid of their popcorn ceiling. Don’t get my wrong, I appreciate those visitors, so I won’t go serving them girating pig refinance ads. However, if they came here via a search, maybe they’d get something out of some related AdSense links. My plan is to serve ads below my sidebar for anyone coming from a search engine. I’m not sure exactly how I’m going to do this yet but there are a lot of engines out there. I’ll probably look for query string clues like &q= on the referrer url rather than going by domain. I’m open to suggestions though if anybody has a better idea.

So Which Service Should I Use?

I’ve applied for a beta membership for the Yahoo! Publisher network which Dustin Diaz says is far superior to the Google program, but then, Dustin works for the big Y! Anybody else have any experiences with AdSense they’d like to share to convince me one way or the other. Dustin, feel free to add your 2 cents as well, I was just pickin’ on ya. :)

ActiveX Update Woes

April 05, 2006

Are all of your client sites April 11th Compliant? I’ve spent much of my day so far going through client websites (many of which we didn’t even build) looking for instances of applet, object and embed tags (mostly flash) to make sure they won’t break on April 11th. On that day, Microsoft will be releasing a security update for IE containing a particularly annoying ActiveX update. Any ActiveX control that a user interacts with will now need to be activated. For instance, if you have a flash movie or multimedia object and a user clicks on it, they will get a nice message like this:

ActiveX Activation

One way of avoiding this annoying activation routine is to call your objects via an external script file. Fortunately we’ve been doing this at work with our flash files for quite a while using Geoff Stearns’ FlashObject. By using FlashObject, swf files will not require activation and users will be able to interact with the flash just as if they never got that silly ActiveX update.

So why is all this happening and who should we blame? You guessed it. Micro$oft:

A jury in 2003 found that Microsoft’s Internet Explorer browser infringed on a patent owned by Eolas and the University of California. The software vendor was ordered to pay $521 million in damages. Microsoft has vowed to fight the ruling, but so far has been unsuccessful in getting the patent invalidated. - Click here to read the full story at Top Tech News

Thank you Microsoft! To read more about making your sites April 11th compliant, visit the msdn page: Activating ActiveX Controls.

CSS Naked Day

April 04, 2006

Ever since Dustin got back from SxSW, he’s been all about the public nudity. To continue this lascivious trend, he’s declared April 5th, 2006 to be the first annual CSS Naked Day. I know. I’m early, but I couldn’t contain my excitement.

Why do I think this is such a great idea? Because so many people don’t understand the impact that CSS and web-standards have on the web. Many of my readers are, like myself, web designers and developers who know the benefits of web-standards. However, some of my most popular posts (like Popcorn Ceiling Removal, Gas Pedal Sticking?, and Sushi from Publix) have nothing to do with web development and attract visitors who probably have no idea what CSS even is. My hope is that turning off my stylesheets for a couple days will turn on the light for at least a few people as to how powerfull stylesheets are and how much of an impact they make to the sites they visit every day.

If you “get it” now and are as tired as I am of seeing this unstyled content, go back to the homepage, scroll down to the dropdown box titled Choose a flavor and select Contemporary Home to switch back to my default stylesheet.