Archive for June, 2005

Greasemonkey Scriptlet for WordPress Comment Moderation

Saturday, June 25th, 2005

It’s Spam Season again, apparently. This means lots of annoying spam comments on my blogs and more time than I’d have liked trying to get rid of them. One little nuisance in particular had been a pain in my neck for two days, and yesterday I finally decided to ease the burden.

When WordPress 1.2’s built-in comment moderation system catches comments it thinks are spam, it sends these comments off into the moderation queue. There the comment can be reviewed, and appropriate action (accept the comment, delete the comment, or ignore the comment and leave it in the moderation queue) can be taken. In order to act on multiple comments at a time (since spam travel in packs), a “bulk action” radio button can be pressed for each comment one wants to peform the selected action upon. Trouble is, when there are 229 spam comments in your moderation queue, this means you have to press 229 radio buttons.

There has to be a better way. Enter Greasemonkey, stage left. From its web site:

Greasemonkey is a Firefox extension which lets you to add bits of DHTML (“user scripts”) to any web page to change its behavior. In much the same way that user CSS lets you take control of a web page’s style, user scripts let you easily control any aspect of a web page’s design or interaction.

Long story short, I wrote a tiny Greasemonkey scriptlet called WP-Delete Moderated Comments which will automatically set WordPress’s comment moderation radio buttons to “delete” rather than “do nothing.” As a result, instead of clicking the mouse 229 times, I merely have to click once on the submit button. Here it is:

// ==UserScript==
// @name           WP-Delete Moderated Comments
// @description    Sets all moderated comments caught in WordPress to be deleted. (Tested with WordPress 1.2 Mingus.)
// @author         Meitar Moscovitz ( http://maymay.net/ ) Copyright 2005
// @include        Change this to your WordPress blog's comment moderation page.
// ==/UserScript==

(function () {
    var e = document.getElementsByTagName('input');
    for (var i=0; i<e.length; i++)
    {
        if (e[i].type == 'radio' && e[i].value == 'delete' && e[i].defaultChecked == false)
        {
            e[i].checked = true;
        }
    }
})();

For those of you who already have Greasemonkey installed, you can install WP-Delete Moderated Comments right now. (Right-click on the link and select “Install User Script…” from the contextual menu. Then change the included page to the appropriate address, as instructed.)

Questions, comments, suggestions and any other feedback are all welcome.

Note: This scriptlet only works for WordPress 1.2 Mingus. No future updates are planned because this functionality is already available in the WordPress core for versions 1.5 and greater.

Crack of Thunder

Wednesday, June 22nd, 2005

At the periodontist today I had my oral implant, the stud for what would have been the crown of a fake tooth, removed. One thing led to another after I left the doctor’s office. I got angry.

At home I picked up the medications from the pharmacy which I had prescriptions for. Sara said she’d take a nap, but I wasn’t tired. It started to rain. Then I heard thunder.

While Sara slept, I took the opportunity to take my single-tail whip, and juggling gear, to the park. I left a note:

Went to the park. Have my cell.

Love, —Meitar

It started raining harder as I walked through Bennett Park. I had originally intended to crack the whip a bit there but as the rain intensified I just felt like walking further. I headed to Fort Tryon Park.

Lightning crackled in the air and thunder boomed as I approached. The rotary at the entrance to the park was emitting a thin, light mist due to the dense cold rain hitting the heated pavement. It felt magical to walk through that veil of steam slowly.

I passed Heather Garden and staked out a small, empty lawn overlooking the Hudson River as my own. I set my backpack and juggling gear down and took out the whip. The weather matched my mood; big, heavy drops of chilling rain, fast flashes of lightning and then a slow, rumbling thunder.

I cracked the whip. Then I cracked the whip again. I took over for the thunder.

I was there for an hour. The rain felt like it was searing through me, hitting my skin, digging a hole through my body and falling to the ground beneath me, cleansing me of my bad mood. It was like I had made friends with the lightning and the wind.

By the time I was read to leave, the rainclouds began to pass on and the sun was creeping out from behind them. Does the weather influence my mood or do I influence the weather?

Momentary Mood Swing

Saturday, June 18th, 2005

Every so often, conversation will drift onto a subject matter which reminds me of two things.

  1. I am not healthy.
  2. I am very lucky.

This is frustrating.

I don’t feel like writing much else.

How To Rank Well in Google — Google’s Site Ranking Algorithm Published

Friday, June 17th, 2005

Spammers have been trying to fool the search engines for years. Trouble is, no one except the search engines know how web sites are ranked in their result lists. Consequently, dozens upon dozens of different tactics have been employed to try and get web sites to rank well.

This is changing.

Google’s PageRank™ Algorithm Public

Today Google’s site ranking algorithm was made public via a public patent filing. This will change lots of things, but not in the ways some people might expect. As it turns out, Google’s algorithms are set up in such a way that makes it incredibly difficult to spam the index with the kinds of techniques spammers are currently notorious for.

Nick Finck of Digital Web Magazine cites:

Now my first thought was “oh great, now every manipulative marketer on the block is going to abuse this info,” but if you look closely you’ll see that if they, in fact, followed these site rank guidelines to their best advantage, their site will become less of a link farm, less of a re-blog, less of a link exchange, less of a faux landing page. And who knows, maybe some more useful content will be generated out of this. [via Jordan Rule]

I’m sincerely hoping that will happen. Just today, I’ve received over three hundred spam comments on my blog from various spammers attempting to raise their rankings with backlinks and targetted anchor text. None of them made it through to the site past my moderation system, but the point is they tried and I had to clean up the mess.

Ethical Internet Marketing Increases Google PageRank

The spammers and the search engines have always been caught in a perpetual arms race. With Google’s ranking algorithm public knowledge, in what direction will the balance of power tip? Does this give the spammers a bigger, juicier target?

I’m inclined to believe that, in fact, this is bad for spammers because it’s good for everyone else. I think this is good for SEO professionals and marketing folk because now we know precisely what works and what doesn’t (and what works discourages spamming) and good for web searchers because more content will be findable. In other words honest SEO works better than spamming, and now we can prove it.

This doesn’t mean spammers will stop what they’re doing, or won’t find new ways of abusing the algorithm, of course. However, it does give every honest internet marketing agency the validation they deserve, and now it also gives them a broader set of tools with which to work. I, for one, can already think of several enhancements I can make to my site to get better rankings—and none of them involve spam.

What You Should Do to Rank Better in Google

Darren Yates proclaims that the days of Spamming Google are drawing to a close. Some of the facets of Google’s algorithm were somewhat obvious, but some of them were very surprising. For instance:

  • The longer the duration you have registered your domain name for, the better pages in your domain will rank.
  • If links to your site propogate around the Web too quickly your pages will rank worse. (Be very careful who you exchange links with.)
  • Fewer higher-quality in-bound links with varying anchor text will make your site rank better than many in-bound links with identical anchor text. (That’s considered “anchor spam” and can take months to recover from.)
  • Delivering regular, fresh content is not ncessarily a requirement for every site to rank well. Whether or not your site should update regularly depends on your market. The idea is to keep information accurate and reliable, regardless of how old it may be chronologically.
  • Site click through rates are monitored from a variety of sources including the Google Toolbar and Desktop Search products, as well as the Google web site. The amount of time it takes for a visitor to return to Google after a click-through is also an indicator of the quality of content; the stickier you make your site, the better.
  • The whois records for your domain name are checked for consistency between the technical and administrative contacts since these records are often faked for spam domains. Make sure the proper information appears in your domain name registration.
  • If your web site is hosted on a shared server, then you share the same IP address as (potentially) thousands of other web site owners. If even one of them gets caught for spamming, you get penalized as well since you share the same Internet address.

Much of this information is a goldmine for web developers and internet marketers. Taken in conjunction with proper coding techniques (such as semantic HTML, proper separation of presentation and content with CSS, external and light-weight JavaScripts, etc.) it can deliver a powerful one-two punch for new and existing web sites that want to increase their Google PageRank.

The bottom line, however, is to ensure that a site grows as organically as possible. Make sure you register new domain names for a minimum of at least two years (I’d recommend three or more), be very careful who you exchange links with, vary your anchor text, and depending on your market, make sure to add chunks of high-quality content to your site every so often.

Finally, make your site is as “sticky” as possible. Encourage visitors to bookmark your pages and to return regularly. It is far more beneficial for a site to get a small amount of repeat traffic than an influx of traffic that never returns.

Life Happens

Thursday, June 16th, 2005

Thankfully, at least for now, the possible periodontic ouches turned out to be an infection (and creating an abscess) on my gum where the implant is. As a result, there is not yet any drilling or other dental torture that needs to happen until the infection can be reduced with the use of antibiotics, for which I was given a prescription. Next week I go in again for an appointment with a scalpel and, possibly, a drill. Hopefully just the scalpel.

This oral infection comes right during the middle of the worst case of acne I have ever had in my life. It’s so bad, in fact, that for a few days my chin was literally white and red and then white and then red again. I tried using some kind of acne medication on it to make the swelling go down, which was so large as to make my cheeks vanish, but that only caused my skin to dry, burn, and now peel. To top it all off, my facial hair is irritating my whole face, too.

What is with the sudden and abrupt lack of health? This will not do. Unhealthyness has to stop, and it has to stop soon.

Save for these issues, most other things in life right now are, for lack of a more accurate word, perfect. The apartment is shaping up slowly but surely. The kitchen has gone through yet another round of development and now bears a real kitchen table, a magentic knife-holder strip, a drying rack, and a whiteboard where Sara and I have left love notesleft a love note and I left a Star Wars quote. (Yes, we’re one of those disgustingly cute couples.)

I have finally managed to clear the clutter in my so-called office space, set up the printer to function as a print server device, and cleaned and organized the entire corner of this room. My to-do list is growing by the hour and it’s become something of a struggle to keep it from expanding exponentially. I’ve already crossed out “clean the toilet,” “call Atlantis,” and “buy more condoms.”

Speaking of which, there is a trip to the Bahamas planned. Sara and I will be spending three days and two nights at the Atlantis Resort and Hotel, courtesy of said establishment and of JetBlue Airways. Last November I had won a free trip for two during a flight to Vermont. On July 25th, I’m cashing that in. w00t!

Cross Your Fingers

Wednesday, June 15th, 2005

Please, please, please not again.

So Much More Hardcore

Thursday, June 9th, 2005

Once again, writing from the Apple Store down in SoHo. There’s a crowd around me, people playing with computers, with iPods, with a number of little gizmos. The ambiance here is nice—in that trendy sort of way with everyone screaming, silently, how much cooler they are than everyone else. Honestly, most of them don’t know what they’re doing or what they’re saying.

I came down for the MetroMac meeting on “Taming Tiger,” a presentation by Deb Shadovitz about ways to use the new version of Mac OS X (“Tiger”) to increase one’s productivity and organization. Unfortunately, most of the meeting was taken up by a show-and-tell of various very, very basic features of the Finder. Customizing icons, how to use the dock, what smart folders and labels are, and other Mac fundamentals were given the most attention.

Spotlight was touched upon, burn folders were too, and nothing at all felt like it needed to be tamed. I’m actually sorely disappointed, especially considering that I’ve recently installed Tiger and felt like there was a lot of new things for me to learn. I’ll bet there really is a lot to learn, but I suppose I’m better off learning it all the same way I always do; I’ll play around with it myself.

I got way too bored sitting in the crowd, playing with my cube, so I got up and ran through the mental checklist of things I need to get for home. Among them, that damned PS/2-to-USB converter. I found a salesperson and asked if they carried one. Amazingly, he looked me square in the face and asked me what a PS/2 six-pin mini-DIN connector was. I pulled him over to a computer and showed him the Wikipedia entry so I wouldn’t have to explain.

You know you’re a geek when the answer to every question is a web address.

I walked in to the store listening to my iPod, and bounded straight up the stairs to head to the MetroMac presentation. I spoke with the organizers, who asked about the times for my Mac Meetings group. I pulled out my iPod and checked the schedules for the meetings on the synchronized calendar. They told me they’d attend.

After that quick bout of Mac geekiness, I couldn’t help but feel the explicable recurrance of I am so much more hardcore than you throughout the presentation. That, and, of course, the fact that I met with Blaise earlier in the day and showed off marks.

Update: Deb is a really nice woman. After the meeting, and after I finished blogging just now, I went back upstairs to ask her a question that came to mind. A friend of mine is considering buying a new computer, but she said that she’s unsure of getting a Mac because, she said, it’s not as customizeable as Windows. I asked Deb what she’d say in response to that. She laughed, as I did, and answered: ResExcellence.com!

To Be and To Do

Tuesday, June 7th, 2005

Sara and I made this list on the subway as we went downtown towards the garment district today:

Things To Do

She shopped for fabrics at a store on 39th Street. After that I took her to Heroboy (and thus struck it from our list of things to do). Once we had eaten (our first meal of the day), we walked through “commercialism central” and stopped at H&M and Old Navy to get me new clothes.

I now have three new shirts, which each fit me rather well and I’m happy to say look “hot” on me (w00t!), and six new pairs of boxers, which I just wanted because I don’t want to do laundry yet. Shopping was fun because it made me feel accomplished; I completed something I had been meaning to do. It also had strong tones of “coupledom,” this feeling I keep having moments of in the best possible way.

It unnerved me that I had suddenly found a new relationship so quickly after breaking up a short while ago. Without any doubt, however, the best part about this relationship is that it is the first in which I feel I can be completely self-expressive, the whole of who I am, and trust that all of that is not too much to handle; when she pushes, I push back—when we fight, we call it a draw. Athena and Apollo.

The rest of the night was spent with Sarah at her place of work. It really pays to be friends with the bartender! The three of us went out for a late dinner after she closed up at around midnight and spoke of personal history and future plans.

Summer is upon us. I love summer.

A Long Time Ago

Thursday, June 2nd, 2005

I like the way events in the present and plans for the future often connect to events in my past. One of the themes in my life is the notion of coming “full-circle,” of interconnectedness, connections of unexpected and delightful things. I am a paradox of sorts to myself in many ways, such as the fact that I have a strong and weak sense of history at the same time.

The other day, Sara met my father and her observations created that sense of coming “full-circle” in me. Over breakfast today, “eggs” with cumin and cheese wrapped in a flour tortilla, I showed her some of the very, very old writings for RPG simulations I created with friends of mine.

It was a blast from the past to read these myself, and I’m still floating somewhere off in space because of it.

Few Problems When Upgrading to Mac OS X Tiger

Wednesday, June 1st, 2005

Finished up backing up my computer and then upgrading the iMac from Panther to Tiger today. It was not without a hitch (though the install on the G3 tower was pleasantly uneventful), but it was worth it. Virex 7.5.1 gave me some problems and ultimately had to be uninstalled. Virtue, my windowvirtual desktop manager, was also causing problems and so I removed it as well. (A shame, I rather liked having multiple virtual desktops.)

Also, Mail.app was exceedingly finicky at first and crashed each time I opened an email in the preview pane. The solution was a simple one: I deleted the com.apple.mail.plist file from my ~/Library/Preferences/ directory. Of course, this means I had to set all my preferences again, including inputting all the data for my email accounts (of which I have more than ten). That was a hassle I could have lived without this morning.

Syncing the computer with my .Mac subscription was not painless either. The upgrade somehow fudged up my current registration so I unregistered the iMac and then re-registered it. I ended up deleting all my data from .Mac and re-syncing everything by replacing the .Mac data with the current (thankfully up-to-date) data on my local machine.

As a precautionary measure, I ran a quick permissions repair using Disk Utility after it all. (I probably should have done so before I started, but I’m not a morning person.)

All in all, a bit of work, but well worth it. The entire machine feels about five times faster—most notably Safari, Address Book, and Mail, all of which were annoyingly sluggish in Panther. Last but not least, the new features are ones I’m definitely looking forward to—Spotlight has already been getting heavy use.