Hello, my name is Karim Ratib. I plan and build Drupal applications using the best modules from the community. I maintain or co-maintain many modules, including Views Bulk Operations and Sheetnode. I specialize in multilingual applications (especially Arabic), configuration management, data modelling and processing, and integrating 3rd party libraries and services. I have good experience leading Drupal teams.

Ingesting the Facebook stream using Feeds and OAuth 2.0 (updated for Drupal 7)

Now that Twitter 1.1 and Feeds are buddies, time to move to other data sources. Next up: Facebook. Using trusty Feeds and friends, I was able to ingest my own Facebook home feed. Here's how to replicate this:

For the impatient, attached is a feature that should get you set up quickly.

Consuming the new Twitter 1.1 API with Feeds and friends

Update: This post now contains a feature that you can import in D7 to see the Twitter feed in action.

The new Twitter 1.1 API kicked in recently, which meant a new cycle of maintenance for anyone consuming their data programmatically. My own Feeds + Views demo site streams #drupal, using Feeds and complementary modules.

Arabic music notation in the browser

I created a bare-bones content filter to add musical notation to Drupal content, using the VexFlow / VexTab music engraving library. Here's a little sample, also showing my fork of the original library to handle basic Arabic musical notation (quarter tones and special scales):

tabstave notation=true tablature=false clef=treble key=Rast notes C/4 D/4 E%@/4 F/4 | G/4 A/4 B%@/4 C/5

Feel free to fiddle with the music snippet above.

A view of nodes and their translations, part 2: optimizing the Views-generated query

Last week, I described a technique to query and display nodes in all available translations. This worked well enough, but a performance-minded reader pointed out that the query generated by Views (that includes N self-joins for N enabled languages) would not scale to a large number of nodes.

My usual approach when implementing new ideas is to ensure the logic works first, and only handle optimization when needed. It's a strategy that has worked well for me in the past.

A view of nodes and their translations

Here's a little puzzle: display a table of nodes, each row containing the same content in all available translations.

How would you do it? Stumped, I asked that question on Stack Overflow a few years ago, but never received a satisfactory reply.

Then, a couple of days ago, someone asked me if I had solved it. I hadn't thought of that puzzle since then, but I would have felt bad answering no. So, with 3 years of i18n work under my belt, I decided to give it another go.

A regular expression Views filter handler

I've needed to build a regular expression filter for a view I'm working on, so I'm sharing the code here because it might be helpful to other people as well. My specific case is that I am building a Blocks administration VBO.

Is there a module for that?

Jeff Geerling graciously transferred his "Is there a module for that?" tongue-in-cheek domain name to me. Thanks Jeff!

Is there a module for that?

So, IS there a module for that? Probably. But if not, the Drupal community is large and will help you. You can even ask me to do it for you :-)

Question to my readers: Drupal queue task sequencing

I asked this question on StackExchange:

Is there a way to use Drupal Queue API to sequence the execution of tasks, like in a pipeline?

My use case is pretty simple: I have a number of tasks executing in the background, doesn't matter their order because they are self-contained. However, I'd like a single task (of a different type) to execute after all the others are done.

How would this be done?

Features and i18n configuration management, part 2: Menu item madness

Last week, I started writing about my tribulations managing the configuration of a multisite, multilingual application using Features, i18n, and friends. I listed the site components that needed to be managed, and described the basics of saving string translations in a feature.

This week, I'll describe a particularly challenging component I had to deal with: inoffensive-sounding menu items. Should be easy, right?

Anonymous wish list sender: thank you!

I received today a gift from my Amazon wish list - namely, the Cat Stevens - Footsteps in the Dark album. Since I couldn't tell from the packaging who purchased this item, I am posting here to tell you:

Thank you! Much appreciated :-)

Syndicate content