Chapter Three LLC

development

Making the web friendly again

Robert Wohleb

There are more than a few Drupal modules and 3rd party services on the internet for trying to manage the flood of spam that websites regularly receive. However, many family-friendly websites need to go beyond merely blocking crude ads. They need to also fight off the hordes of forum trolls and instigators.

A few services fill this role, such as the excellent WebPurify web-service (nominal yearly fee). We developed our WebPurify module for Drupal while working with PBS. Being one of THE family-oriented destinations on the Internet, they couldn’t let anything pass that wasn’t “COOKIE MONSTER APPROVED”.

Luckily for us, and Cookie Monster, WebPurify exposes a simple REST API, using the now common XML-over-HTTP paradigm. Their documentation lays out the request and response formats, and even provides a simple PHP example. Our module provides a nice wrapper around the intracies of using this REST interface, and even provides comment filtering right out of the box. The exposed API even lets other Drupal developers use WebPurify in their modules.

HOWTO: Creating a URL Shortcut for Drupal API Documentation in Firefox

Josh Koenig

Every Drupal developer/hacker knows (or should know!) about the fantastic API Documentation the project has. This growing collection of documentation is one of the top reasons that Drupal continues to grow and expand as quickly as it does. It makes it very inviting for engineers to start getting savvy.

This started out more than a year ago as an independent project called “drupaldocs.org,” and at that time there was a neat feature that let you type drupaldocs.org/function_name into your browser’s location bar, and it would pull up that function, or search for function names containing whatever you typed if no exact match was found. This is similar to how php.net works (try php.net/preg_replace for instance), and it’s a really nice thing for developers like me who elect to outsource memorizing engineering minutia like argument-order and specific syntax to the collective intelligence.

However, with the launch of api.drupal.org, the old style of finding functions went away. Alas! For months I despaired, until some of the heads in #drupal (developer chat channel) clued me in to a great feature in Firefox that lets you define wildcards in bookmarks.

FF bookmark for drupal api

As it turns out, there still is a url that you can add a function_name to on api.drupal.org to perform a quick search, but it’s http://api.drupal.org/apis/4.7/function_name (or http://api.drupal.org/apis/HEAD/function_name if you want to search the budding 5.0 code). Using Firefox’s bookmark interface (see the image there), I created a bookmark with a wildcard (%s) and a keyword (api). This lets me type “api function_name” into my browser toolbar, getting access to the documentation faster than ever!

While many engineers with a background in big-league IT will probably remain committed to Integrated Development Environments, collecting little tips and tricks like these can give us upstarts and new-schoolers a lot of power and flexibility without very much work at all. Happy drupalling!

Syndicate content