Archive for April, 2006

Better spamming

Just got a trackback for somebody selling Battlestar Galactica videos. At least it’s something I might buy.

But not from you.

Thanks Akismet!

So this is what it looks like?

Just to keep it in memory, a look at what the front page looked like before the site’s design was completed.

Beta is the new Under Construction

Sorry for there being absolutely nothing here, but it’s brand frickin’ new, ya hear?

Right now, my little drones are meticulously working on every detail, making sure that you get the best possible internet experience. That, and we’re still learning what these darn HTML tags are. Did you know you can make text blink? Yeah, it’s awesome. Everybody’s gonna be using that.

So, um…keep checking back here, and you’ll continue to see drastic progress, taking this from a pile of suck, to a much lighter pile of non-suck.

You might be asking yourself, “Self, what’s going on…what’s with all these fancy bells and whistles?” Well, let me tell you: you need a life. There’s t’ain’t no bells, nor whistles, and the closest this place gets to fancy is when we’re kinda sleepy, and we accidently put on a clean shirt.

Stay tuned, as the fun just keeps on coming!

– – –

Either I’m getting really good at this, or I wasn’t really all that ambitious. I’ve finished almost all of the structure of the site, and within only a few hours. It’s hard to believe that this was something else, yesterday. Other than a tweak or two here and there, now it’s all just copying Apple.com and enjoying those sweet, sweet venture capital millions.

And can somebody please explain to me what this picture was doing on my server?

MacStansbury.com

That’s just spooky.

– – –

Well.

This is as good as it’s gonna get. Welcome to the new MacStansbury.com, the home of fun. Since no page Under Construction page is ever complete without this, I thought I’d add it:

This page is under construction. Please come back and see the vast improvements I’ll make, and the zillions of new tabs and buttons that’ll make this place look as clean and neat as that one guy who sold some pixels for a million dollars.

FeedBurner and Google AdSense

Thinking about how to reduce my own costs, track visitors, and continuing to rule the world, I wondered about how I could most effectively keep away any potential visitors to this site. The first thought was rotating blades and hot coals, but that would be difficult (if not impossible) to implement, and it would be cost prohibitive. It was when I was working on keeping the With a linkness RSS feed simple I came upon a couple of ideas:

1. FeedBurner provides a simple, easy way to keep me from having to pay for all the bandwidth I’d give up to all you interneters
2. FeedBurner provides a simple, easy way to stick ads in the feed, thus keeping daddy in penny loafers

Both of those ideas strike me as opposite of what I should be doing. If I was going to provide a full-content feed, why would I not put ads on my site? That should really be the other way around, since FeedBurner makes it relatively free to publish to the entire internet. So, why stick Google AdSense on something that cost me nothing, yet let you see the site with no ad-clutter? And there you have it.

The magic word is “see” in that sentence. I want you here. Sure, I provide a feed to the news, but (eventually), I’ll unleash my evil unto the world, in the form of written stuff. There’s no feed to the static content, and all I will post in the news feed is that the static content exists.

Another reason for the ads, I get absolutely no stats bounce with you reading an RSS feed. As much as I hate feeds that cut off after 40 words (also known as summary feeds), at least they get you to the site. In it’s current incarnation, MacStansbury.com has no comments, forum, or much of any user interaction, other than the Trackbacks/Pingbacks. Other than looking at the pretty site design, there’s little different on the RSS feed than on the site, other than one is a masterpiece of coding, and the other is whatever Yahoo! makes it look like. Or Pluck. Or BlogLines. Et cetra, et cetra.

The point being that I go to a site for the look and feel. I read stuff in the RSS Feed Reader of Legendâ„¢ because it’s fast. 300-1,000 word opuses don’t translate well to the form of a newspaper. Hit the site, you won’t regret it.

NOTE: I stopped doing this a long time ago. No sense in wasting the effort on making the feeds mess up for almost everybody when I wasn’t making that much money off them.

Textpattern RSS now redirected

I’ve found a way to get the Textpattern RSS feed redirected to the WordPress RSS feed…with my mind…and a good helping of PHP redirects. And voodoo. And luck. And code stealing.

For years I’ve had a Texpattern instillation here at MacStansbury.com. With that, I set out to spread the good news of RSS feedness to all those who would listen. Now that everything is different, I keep seeing the occasional /?rss=1 in the referrer log. This can not stand, and thanks to somebody else who I stole some code from, it didn’t stand.

If you can read this, thank Dave. He’s the one who figured it out.

Codely, it looks like I added this stuff:

$atom = $_GET[ "atom"];
if ( $atom == 1)
{
header( "Location: http://macstansbury.com/feed/atom/");
exit( 0);
}
$rss = $_GET[ "rss"];
if ( $rss == 1)
{
header( "Location: http://macstansbury.com/feed/");
exit( 0);
}

The most important part being clearing out the curly ” in the code. Stick that in there and you’ll get nothing but errors. It’s one of the “features” of WordPress, putting in curly quotes. Make the paragraph text look neat, but the code? Not so much.

Okay, back to not posting anything.

Creating the Callouts

This is the working story of how I got the funky boxes on the left and right of the post to show up. When I perfect the technique, you’ll see this sort of thing all over the internet. Callouts, man, it’s the wave of the future. I be even magazines and stuff will have them.

What got me thinking about callouts in the first place was how I wanted a distinctive look. That, and I love stealing code from people, then finding out it doesn’t work, then have to reinvent the wheel, if you wheel, then as I’m finishing up, find it explained simply somewhere else. I love frustration.

Mainly I was (and am) looking for a way to make things look like I want them to look. The easiest thing to do would be to create a graphic with the text I want in the look I want. That’s what Apple does, and if it’s good enough for them, it should be good enough for me, too, right?

Callouts, man, it’s the wave of the future.

Well, for any sane person, yes. But, as I’ll establish, I am not a sane person. I have needs; needs I can only fill with endless tinkering with CSS, late at night. Yeah, I’m disturbed.

The most annoying thing is how this will only work in good browsers (read anything not Internet Explorer). I’m not even sure I should worry about making it work anymore. IE is the devil, and anyone still using it deserves all the bad they get. Internet Explorer is the modern bane of the CSS designer; it causes more problems than it solves.

That, and you’ve got the problems inherent in the actual coding for good browsers. Luckily, I use Safari, and I’m the only one who reads any of this stuff, so we’re all good, right? The biggest problem now is getting the width of the boxes to stay the same. Luckily, a simple width: 130px; selector finishes that off. Then you clean up the borders, margins, and padding, and you’re done.

However, as I was thinking I had everything fixed, I ran into another problem, the drop-cap. I’m using a drop cap technique called first-letter. It’s commonly referred to as a “Pseudo-Element” Selector, but you don’t need to know that, it won’t be on the quiz. All you need to know is that by doing that, you get “magazine-style” callouts. That, dear Apple.com, is what I was trying to get. Here’s the CSS used for me, here:

div.entry-content blockquote.call-left {
font: 16px/1.2 “Times New Roman”, Times, serif;
float: left;
margin-right: 0.9em;
background: white;
border: solid 3px black;
padding: 0 0.5em;
width: 135px;
text-align: left;
}

div.entry-content blockquote.call-right {
font: 16px/1.2 “Times New Roman”, Times, serif;
float: right;
margin-left: 0.9em;
background: white;
border: solid 3px black;
padding: 0 0.5em;
width: 135px;
text-align: left;
}

blockquote.call-left:first-letter, blockquote.call-right:first-letter {
font: 400% “Times New Roman”, Times, serif;
float: left;
padding-top: 0;
margin-top: 0;
line-height: 48px;
}

.dropcap {
float: left;
font: 60pt/0.8em Helvetica, Verdana, Arial, sans-serif;
color: black;
margin-right: 3px;
}

Or just get the file here: callouts.css (right-click, save as)

Now, you’re probably wondering why I use em in there, and px everywhere else on the site. Anywhere I’ve mangled the CSS, I’ve taken out the stolen em and replaced it with px - but not here. Quite simply, it’s because I don’t need another thing complicated matters. For some, unknown reason, IE likes em better. Sometimes. That’s why it’s in there.

And I forgot to take it out.

The folks I steal copy are smart about burying their code so that it works nested.

Also notice that I left the CSS selectors in human readable format. There’s nothing more confusing than trying to figure out what I did to get that to go where I wanted when and where. That goes for anything you put in any kind of coding; it doesn’t matter how wonderful and smart your code is, if nobody knows how to use it.

There’s also a structure to it all. The folks I steal copy are smart about burying their code so that it works nested. If you look at it from a purely textual basis, the blockquote that is call-left or call-right inside the DIV that is named itemtext2 has these properties, and the first-letter of the blockquote has these properties. So, that means…er…not much to you. All you care about is that it looks like the little box thing is on one side of the picture or the other, and there’s enough whitespace to be readable, and nobody plagiarized anything.

Now, I know a thing or three about page-layout. You want to balance your images so that your eye isn’t drawn to one side or the other willy-nilly. I got a B in a photography class because I “trapped some whitespace.” As your story gets longer, you want to space out your gimmicky elements. Even now, I keep moving the blockquotes on the page to balance the story. They are graphic elements that are more for show than for content.

Making your site more Digg-resistant

Social technology site Digg.com is just one of those Web 2.0 sites that are fully jargon and buzzword-compliant. Being so popular, when somebody puts in a link to a small site/blog, that small site/blog/message board/wiki goes boom! So, imagine my surprise when I saw this on Digg:

Digg-Defender uses the WP-Cache system hook to redirect requests from high-traffic sites like Digg and Slashdot to a free global cache system.

Well, hecky darn! I need to get me some of that plug-in! However, when I went to look up the plugin, the site was down. Down in the comments, there were some mod_rewrite rules. That, I thought, would be something to try.

After installing the rules, I had another quandary: how to get Dugg. Or /.ed. Or Farked. Or Boingboinged.

My problem being there was no easy way, without blog-whoring, that I could get my site on one of these sites. Then I saw something in the sidebar. Digg shows people who’ve blogged the story.

Trying this for the first time, I’m not sure how it will work. The main point is to get the mod_rewrite rules to cache the page so it doesn’t take the page down. There’s been a couple of instances when I’d love to post a comprehensive example of how to do something on Digg, but feared the hundreds of hits in just a few seconds that would burn the house down.

If these few lines of code work, that won’t be (much of) a problem (note the . in the site addresses):

RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^aaa.bbb.ccc.ddd$
RewriteCond %{HTTP_USER_AGENT} !^Googlebot
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteCond %{HTTP_REFERER} ^http://([^/]+.)?digg.com [OR]
RewriteCond %{HTTP_REFERER} ^http://([^/]+.)?slashdot.org [OR]
RewriteCond %{HTTP_REFERER} ^http://([^/]+.)?slashdot.com [OR]
RewriteCond %{HTTP_REFERER} ^http://([^/]+.)?fark.com [OR]
RewriteCond %{HTTP_REFERER} ^http://([^/]+.)?somethingawful.com [OR]
RewriteCond %{HTTP_REFERER} ^http://([^/]+.)?kuro5hin.org [OR]
RewriteCond %{HTTP_REFERER} ^http://([^/]+.)?engadget.com [OR]
RewriteCond %{HTTP_REFERER} ^http://([^/]+.)?boingboing.net [OR]
RewriteCond %{HTTP_REFERER} ^http://([^/]+.)?del.icio.us
RewriteRule ^(.*)?$ http://macstansbury.com.nyud.net:8080/$1 [R,L]

To explain, the aaa.bbb.ccc.ddd is your IP address, so you are never sent to the Coral Cache, regardless of where you come from. Note that the last line is MacStansbury.com-specific; replace that line with your own site. If it is in a subdomain (like site.com/wp/ or blog.site.com), use that full name.

I’m not fooling myself by thinking I’m gonna get Traffic Santa’s blessing. But if a big site ever picks up on a story here (hah), the server will be shielded. And there’s really no reason to include all those sites I listed, or to stop with just them. You can add whomever you think will, for good or for bad, link to you, and you’ll be safer.

A site that gets /.ed or Farked gets Sith Traffic, or traffic that does nothing but eat up resources, and doesn’t really boost any of your site stats. That’s not what you want. In fact, getting a link on a big site will bring you the most wretched form of scum and villainy in the known universe: spambots, and lots of them. That’s the real danger of the big link, and why you really need to add this to your .htaccess file.

Or, try your best to remain in obscurity. I’ve done that for years. Well, less ‘tried,’ and more ‘forced against my will.’ Your mileage may vary.

This is a quick first step. There are other sites that I don’t want sucking up my bandwidth. I’ve already sent a lot of traffic away through mod_rewrite. The worst thing about this would be if I make changes, they won’t be reflected in the cache. If you want to see any updates to the story, remove the nyud.net:8080 from the address.

UPDATE: Uh, no, no the sidebar thing on Digg does not send traffic to the right place. Back to the blog-whore.

Or, to be more specific, not to the right page. It works just fine, only if the send traffic to anywhere but the front page.

This was written…in the future

Originally, I set this post with the date of 2005, just checking the Live Archive to see what multiple years and categories would look like.

Guess what? It’s as cool as I thought it would be.

The site is continuing to amaze me as far as how putting all these good ideas together creates such a unique look, and the coding that’s gone into it all. I’m also humbled at how I’m merely taking all the other people’s hard work, and using it pretty much for myself, if my stats are any indicator.

I’d never thought about this before, but there’s this thing called CSS Reboot, where people simultaneously unveil their standards-driven designs. Read about it here. I thought it would be neat to be part of this…but it would be less a reboot as a…boot.

Well, so I won’t be participation officially (what with all the domawhiggies I have stuck all over the place), I will watch the other people, and steal learn from what they’ve done.

Then rob them blind.

In case anybody was wondering…

The Feedback form actually works, now.

I know you were all dying to know that.

Living and dying on my every word.

I have no life.

It’s times like this I’m amazed at coders

You would not believe what I had to go through just to get the archive to the miniblog section, the one I’ve affectionately named “With a linkness.” For the most part, it’s a really easy little plug-in to install…but implementing it is a gigantic bear.

First, you have to create a new page, but not the kind of page you’re used to creating, this one you have to build from scratch. Since there’s php commands, you have to use the template and add all the other good stuff in there. That’s not all that bad, as you can hack up the page as you want, and you really have a lot of control in what goes where. One of the things that I noticed was there was no way to view archived links.

I was thinking that somehow I missed how to build the archive somewhere in the documentation, when I found out the development had moved to a guy named Joe. Fine and dandy, “just gimme my archive” I was thinking. Actually, I wasn’t thinking that, I was rather thinking it was great that somebody was updating it to work better (or, at all) with WP 2.0.

Looking through the documentation, I found out there was that very thing I was looking for: and archive function. All I would have to do is put in one simple link, and I’d have me some loverly archive action going on. Problem: not only was this plug-in coded with Kubrick in mind, it sort of ignored all that coding I’d put in the style. So, more hacking of a plug-in so that I’d never remember all the edits I’d made.

Head. Bouncing. On. Table.

It’s a good thing that the plug-in was made so clearly, as I was able to hack it pretty easy, and I removed some of the nicer stuff in my code just to make it all look the same. Anyways, now the links have an archive. I’m pretty pleased by this.

I can tell you, right now…

…that Bad Behavior works.

And, that it will block you if you use some crazy settings on your browser.

I know this from first hand experience.