Corrections to Auto-print Regex

Several months ago I published a regular expression that would strip auto-print links from webpages. Unfortunately, the regex doesn’t actually catch everything, so here’s a corrected version:

replace(/((window|self)\.print(\(\))?|print\(\));?/ig, "");

This will catch all the following:

print()
print();
self.print
self.print()
self.print();
window.print
window.print()
window.print();

Further, the addition of the g after the / means all instances of the print command will be replaced, rather than just the first, and the i means this will work regardless of whether or not the command is written entirely in lowercase text.

I’ve also noticed a separate issue that I’m still not sure how to resolve — if the rule is set to run on all content-types, it will blindly strip out instances regardless of whether they’re actually operational JavaScript (e.g. the above ‘all the following’ section); if it is set to only run on the JavaScript content-type it will miss any instances that don’t appear in a JavaScript file.

I suppose an even more complicated variation could be made that checks for things like javascript: or <script>…</script>, but it really begins to spiral out of control. If anybody has a solution for this problem, I’d love to know.

written 27 November, 02009 Comments

Quick Tip: Stop Auto-printing with GlimmerBlocker

As part of my high-volume web reading habits, I click through to the print versions of articles whenever possible. Annoyingly, sites will often use JavaScript to automatically make the page print. Here’s a simple way to stop it.

  1. Download and install GlimmerBlocker.
  2. Create a new Filter group (top left of preference pane).
  3. Add a new Rule.
  4. Set the Action to “Whitelist URL, optionally modifying content”.
  5. Set Host: to “all hosts”.
  6. Go to the transform tab.
  7. Paste in the following text: replace(/(window|self)\.print(\(\))?;/, "");
  8. Save the rule.

The regex here will look for window.print or self.print (with or without parentheses) and strip it, thereby stopping the automatic print command.

I forget exactly how I came up with this, but it works great.

UPDATE: an improved version is available.

written 13 August, 02009 Comments

On Tumblelogs

Samuel Fine:

The tumblelogging phenomenon is an interesting solution to the major problem with capital-b Blogging: that humans are intensely diverse and complicated beings, and consistent long-form articles are both impractical and inadequate for the type of creative expression toward which most people strive. In short, I don’t want to write 3 paragraphs about every day of my life, and you probably don’t want to read it. There are better ways to get the job done, and tumblelogging is one of them.

Tumblelogs are an attempt to capture the diverse forms of expression that the web affords; a way to present a reconstructed portrait of our fractured online personalities. This is definitely a problem that needs to be solved, and the problem continues to worsen as we are presented with a rapidly-climing number of ways to put ourselves online. Now that tumblelogging has had an official name for just under four years, I think it’s been long enough that we can make some judgements regarding the format’s success.

Tumblelogging’s most obvious win is that it provides a simple way to share whatever happens to be on your mind at a given moment, with no concern for editing or choosing the appropriate service or anything like that — as Jason Kottke said, A tumblelog is a quick and dirty stream of consciousness, a bit like a remaindered links style linklog but with more than just links. For services like Tumblr and Soup, the user need only choose the type of entry (image, quote, link…) and drop in one or two pieces of information.

But there’s always a downside. I’m not the sort that cries about the loss of some likely-imagined higher level of Quality that was part of restricting self-expression to those with more money and technical knowledge; instead, I’m primarily concerned with the increased volume of output that tumblelogs encourage. I don’t necessarily see this as a fault, but I do feel that it means current tumblelog implementations have served to worsen the problem of the reconstructed portrait I mentioned above.

I’ll grant that this may not be a fatal flaw — at least for the moment — but I see potential for the idea to be more than the current ‘post it all here!’ approach. I see tumblelogs being something more like Phil Gyford’s technique of publishing content on a variety of dedicated services, then pulling it all back together to show what was done on a certain day.

But more importantly, I prefer the curated approach. While this reduces the immediacy and freedom, it’s also a mindset that encourages the user to spread meaning. Casual sharing is better done with bookmarks and favorites, where the effort needed is equal to one’s interest.

There’s value in being able to click a few times and share anything at all; there’s more value in sharing stuff that matters.

written 6 April, 02009 Comments

X-treme Advertising! Yeah!

Dan Frost, for the Los Angeles Times:

They’re bigger, they’re bolder, and soon they’ll be covering up large swaths of some of your favorite Web pages.

The Online Publishers Assn. on Tuesday released several new in-your-face advertising formats designed to be both more obtrusive and interactive.

Studies show we ignore banner ads, said Jose Castillo, a new media consultant in Johnson City, Tenn. “Making them bigger and more intrusive won’t work. We will tune those out as well.”

Mandy Brown, two days ago:

Through this premise we find ourselves in a familiar conundrum: it is the reading experience that brings people to the web, thereby making them available to the siren song of the advertisers; but it is the advertisers, who, in their effort to gain purchase over ever more significant corners of our brains, must distract and diminish the reading experience lest they be ignored. The story goes that every so often an advertiser surprises with a particularly innovative method of annoyance, after which a certain amount of time passes and we learn — automatically, involuntarily — to tune them out.

To me, this venture is clearly a terrible idea. Annoying users is a poor choice of business model.

written 11 March, 02009 Comments

‘Media-Morphosis: How the Internet Will Devour, Transform, or Destroy Your Favorite Medium’

Cory Doctorow:

The Internet chews up media and spits them out again. Sometimes they get more robust. Sometimes they get more profitable. Sometimes they die.

It’s a scary thought, especially if you’re personally attached to an old medium like movies, books, records, or newspapers.

The article briefly covers the concerns of newspapers, films from major studios, music labels and artists, and books.

From the section on films:

So, we may be at the end of the period in cinematic history where we can convince investors to pony up $300 million to make a sequel to a sequel to a remake of a movie adapted from a 50-year-old comic book. Which isn’t to say that no one will make these things henceforth — give it a decade or two and there may well be rich weirdos who fund these productions the same way there are lovely old codgers who can be coaxed into putting up the dough to mount 15-hour, all-singing, all-dancing Wagner operas. Not a mass medium, nowhere near as culturally relevant as BBMs are today, but still a going concern as a vanity/prestige form.

That sounds familiar, as does this comment about distraction, from the Books segment:

On the other hand, for many kinds of books — long-form narratives, for instance — reading off a screen is a poor substitute for a cheap and easy-to-buy codex. Not because screen quality is insufficient (if it were, we wouldn’t all spend every hour that God sends sitting in front of our computers), but because computers are damned distracting.

written 21 February, 02009 Comments

The Web and Journalism

Dan Lyons, writing about Apple’s public relations and press:

The fact is, in the eyes of the media, Apple is the corporate equivalent of Barack Obama — a company that can do no wrong. Even in Silicon Valley, where much of the press corps are pretty much glorified cheerleaders (think of all those slobbering cover stories about the Google guys) Apple’s kid-gloves treatment stands out. Reporters don’t just overlook Apple’s faults; they’ll actually apologize for them, or rationalize them away. Ever seen reporters clapping and cheering at a press conference? Happens all the time at Apple events.

Newspaper folk are particularly inclined to complain about the negative effects the web has had on reporting.

James Warren:

In journalism’s new Internet-dominated landscape, in which attitude and attack are often valued more than precision and truth, handiwork like John Crewdson’s is seen as taking too long and costing too much. His situation is hardly unique — the other investigative reporter at the Chicago Tribune’s D.C. bureau was told to leave at the same time, as was the top investigator at the Washington bureau of The Los Angeles Times, which is also owned by the Tribune Company. But as an example of journalism’s very best, Crewdson’s dismissal is a symbol of the extent to which the news media are imploding. And that implosion is a development with far-reaching implications.

Meanwhile, websites are not obligated to spend money on newsprint, printing plants, or union drivers to drop their product at readers’ doorsteps. Yet they benefit from linking to all that work they’ve not done or paid a nickel for. And they supplement this borrowed reporting with user-generated content and material produced by freelancers who are paid a pittance or nothing at all. They’ve also opted for chat rooms and ongoing dialogues among their adherents — a laudable, democratic impulse, but one that often devolves into an unedited legitimization of stupidity and bigotry.

Why should we care?

This matters because of the unique role journalism plays in a democracy. So much public information and official government knowledge depends on a private business model that is now failing. Journalism acknowledges and illuminates complexity, and at the same time prioritizes, helping us to evaluate the relative significance of developments playing out all around us. …

And, importantly, there’s a sense of social mission. Good journalism keeps public and private officials honest and helps citizens make thoughtful decisions. It does this by systematically gathering, processing, and checking relevant information, and by doing it with a spirit of independence. It’s how two previously unknown Washington Post reporters, Bob Woodward and Carl Bernstein, put together the Watergate puzzle that forced the 01974 resignation of President Richard Nixon. And as they pursued their investigation, they, like all good reporters, followed certain commonly accepted ethical norms: You don’t take money from the people you’re covering. You don’t bow to special interests or to the economic interests of your employer. You confirm and reconfirm the accuracy of assertions and supposed facts and quotes. As an old saying used to go at the City News Bureau of Chicago, a now-defunct training ground for decades of reporters, “If your mother tells you she loves you, check it out.”


It seems to me that there’s a real opening for bloggers to do serious journalistic work. Although newspapers and TV reporters give us the major stories, they also give us a lot of garbage we don’t want. Bloggers have the advantage of highly targeted, self-selected audiences.

And if print is withering and the web is the platform of the future, then we need to have people who are intimately familiar with the web to begin filling the gap. With no writing-related income except from readers or advertisers, a web journalist is under less pressure to leave out information or avoid certain subjects.

I can’t say whether this will happen, or what form it will take, but I have been thinking about this for several months now. Here’s my thoughts on what it should look like.

  • Make changes visible. Everybody makes mistakes. For newspapers, this means publishing retractions and corrections. Unlike print, which can’t be edited after publication, the web is infinitely rewritable and has no space constraints. Publish retractions and corrections as usual, and update the relevant article — but don’t just edit it; let readers see what’s changed.

  • Share your source material. I don’t agree with the idea that journalists are the only ones able to draw together information in an informative, useful way. Journalists are often better at it, but stories have their own trajectory and the journalist will necessarily miss one or a dozen alternative stories, some of which may be even more interesting or significant. So publish everything that inspired you, that helped you along. Articles, book excerpts, conversations, anything. Unless it would cause a source to be fired, it should be shared — and even then, consider doing it in a paraphrased form.

  • Let readers become writers. Readers will find unexpected uses for your material. If they care enough to create something new, then you should care enough to let them publish it on your site, or give a good link if they have their own site. Encourage others to do what you’re doing — you can’t specialize in every subject or write all the stories the world wants to tell, but others can help. This may even be something as simple as translations.

  • Develop a consistent, powerful form of organization. You may take the approach of Steven Johnson or James Fallows, shoving everything into a freeform database that’s brilliant at working with text. You may go my route and shove everything into a bookmarking system, recording metadata and keywords. Whatever your technique is, make it available to everyone else.

But if you want readers to be involved, personal organization isn’t enough.

  • Use clean, clear URLs. There should only ever be one way to link to your article. Make it easy to find. Don’t do what newspapers and magazines tend to do with their web versions, offering regular views, print views, multi-page views and single-page views.

  • Develop a good keyword system and use it everywhere. If I want to find things relating to, say, Steve Warren, I search my bookmarks for by:stevewarren and stevewarren. If I want to find things relating to music, I search my bookmarks for music. Although it takes extra effort to record these keywords when reading, it pays off fabulously later on when you know you read something about music that had an idea you want to reuse but can’t remember where or when you read it or who wrote it or…

  • Develop a good source storage system. I don’t know what the best approach would be. Wikileaks and Wikisource seem to do well with the wiki format, but that may not be ideal.

  • Remember to share your legacy. Dave Winer, in 01994: This offer expires on 10/31/94 — who knows how long these messages will live? — I still get requests for a freeware program I wrote in 01988! The effort that you put into writing now is worth more and more as time goes on. Spread your work around as much as possible. Not that you should put everything in the public domain (but good work if you do); I personally use Creative Commons to allow others to reuse my work under certain conditions.


I’m breaking my own rules. I have ideas, but I’m not much good at programming or writing. I’m also running on a publishing platform I don’t entirely control, which makes some things impossible.

So where do I stand?

Changes are visible. Because all my articles are co-published in a version control system, it’s possible to trace the history of what I’ve done. But although it’s convenient for the author, it’s not overly convenient for the reader.

Source material and organization: As noted above, I use a bookmarking system that holds just about every external document I link to in my entries, along with a ton of stuff I don’t have an immediate use for. Like the changes, the system is pretty transparent, and it’s certainly convenient for me. But running it on this site directly would be better, because I could simply pull over the tagging system and have my keywords. A bigger issue is that bookmarks don’t save copies. I can generally rely on the link still working a year or two later, but it’s not guaranteed. If I were to save my own copy I wouldn’t have to care.


But none of stuff I’ve written up there means anything unless you’re writing.

If you aren’t, why not? We all have something to say, even if we’re not very skilled at saying it. I doubt I’d be hired to write a column, but I enjoy doing it here for free.

If you are, consider opening up the process. But more importantly: keep writing. You don’t know when your time will come.

written 30 January, 02009 Comments

‘The Self-governing Internet: Coordination by Design’

I tend to forget how fortunate we are that the Internet is largely decentralized, free from the control of organizations that would force us to pay for the right to do anything.

There are still plenty of walled gardens, but over time they open or crumble.

written 13 January, 02009 Comments

NewsGang Live, 28 December, 02008

Pondering health care and the future of the web.

written 8 January, 02009 Comments

Online avatars

In order to have a single image representing me, I need to put it in the following places:

  • Address Book.app
  • Dopplr
  • Facebook
  • Flickr
  • myOpenID
  • Twitter
  • Tumblr

… and stuff I only use occasionally: Gmail, Vimeo, iusethis, YouTube, FriendFeed, and so on.

There are a variety of roads to the goal of a single profile image — Gravatar, the hCard microformat, and OpenID, among others — but none are universal. I’d like to see the latter two win, but microformats are a solution whose problem hasn’t fully appeared, and OpenID has only begun to see any sort of widespread implementation. OpenID does seem to be on an upward rise, though, so I have hope there; microformats are still uncertain, due to both the lack of practical application and the technicality of implementation.

written 7 January, 02009 Comments