Using Regular Expressions to Muffle Tweets in Twitterrific (iOS)

From the “using a hammer to hit a screw” department, I spent some time today working on a regular expression to mute any mentions of D*n*ld Tr*mp in Twitterrific, the (fantastic) Twitter client for iOS.
Regular Expressions1 can be difficult to write. I found them intimidating, and I’ve been mucking about with programming for years now. There are numerous regexp tutorials available on the web, but Google’s Examples of Regular Expressions was the only one I’ve used that made sense to me.

Without any further ado, here’s the pattern:

And now it’s time for a breakdown:

Character Description
() Groups all the words together
\W Matches any character that isn’t a letter, digit, or underscore and prevents the expression from matching anything that comes before or after the phrase you want to match
\⎮ Indicates “or”, so the pattern matches any of the words in the list2
^ Matches at the start of a string or a line
\s Matches a space character
$ Matches the end of a line

You’ll want to test your pattern to see if it matches the desired characters while ignoring others. RegExr is a web-based tool that helps you learn and test regular expressions. The next step is adding the pattern to Twitterrific. Bring up the sidebar in the app and select Muffles.

This image shows the interface for adding muffled or muted phrases to Twitterrific, a Twitter client for iOS.

Select “Tap here to begin” on the next screen, and then add your pattern by writing it out like this:

Name of pattern :: pattern characters

On my phone, that looks something like this:

This image shows the interface for adding muffled or muted phrases to Twitterrific, a Twitter client for iOS.

Click the Done button and voilà, no more mentions of that garbage human (or any other annoying content) in your timeline!

Sure, I could have achieved the same end by entering this person’s exact name to my muffles3, but if I’d done that, I wouldn’t have learned anything, and I would still be intimidated by regular expressions. Now I’m…less intimidated, which counts as a win in my book.

  1. Also called RegExp. 
  2. Did you know you can’t escape the pipe character in tables in Markdown? You have to use Unicode or ASCII. I KNOW. 
  3. Muffles is Twitterrific’s term for muted words and phrases. 

Help Me, Code Club (Ruby Help Needed)

I wrote a ruby script that generates a five-day forecast for your location based on the city name or postal code entered. I’m pretty proud of the work I did, and I’d like to take it further, but I don’t quite know how.

I’d like to turn this into a LaunchBar Action (or Alfred Workflow) that will pull this information into LaunchBar/Alfred and serve related GIFs that illustrate the forecast for that day. There are actions and workflows that do this already, but the additional bits of code that pull everything together are far above my skill level.

An image of a LaunchBar action that shows the weather forecast.

a screenshot of a LaunchBar action that shows the extended forecast for Vancouver, Canada

Here is where I hope other ruby developers1 can help me. I need someone to sit with me and walk me through the LaunchBar/Alfred actions over Skype and help me understand what’s going on. I figure two to three 30 minute sessions should be a good enough start, but I’m flexible and would appreciate any help you’re able to give. I’ll even throw a gift your way in appreciation.

If you’re able to help, leave a comment below or reach out on Twitter.

  1. or JavaScript. I’m not picky. 

Mac Power Users Podcast: John Gruber

This Mac Power Users episode is about 45 minutes too long, but Gruber has a unique perspective on the way computing has evolved since the early 90s.

I became a Mac user when the line for the x86 computers in the university computer center was too long, and I had a paper due. I taught myself HTML on a Mac using TextEdit, and it’s still my platform of choice almost 20 years later.


Items I’ve Put Into Pocket And Will Read Eventually

I have the best of intentions, but I don’t always get around to reading the items I save to Pocket. Here’s a short list of the items I’ve filed this week:

Hot Take: Class Feelings and LIS

Growing up I was never told that I could be anything I wanted to be – there was a lot of assumption that because of my class status (and also probably because I was female) that my lot in life was pretty much set for me. I absorbed this attitude and I got through a bachelor’s degree without engaging in much of anything because I didn’t belong there – I was a perpetual outsider everywhere.

I’ve felt this way, too, and it’s one of the main reasons I started the #L1S Tweetchat. The chats will resume after surgery, most likely in August. However, if you’d like to moderate a #L1S chat sooner than that, let me know!

Ice the Tea, Not the Coffee
My favourite summertime beverage. When I lived in Atlanta, I drank giant 64 oz. tumblers of the stuff several times a day. I was also ignorant about calories. Maybe I was defiant. I’m not really sure. What passes for iced tea in Vancouver is absolutely terrible, and the only place I can get anything that comes sort of close to what I’m used to is Starbucks. I’ve decided to make my own this summer, and I’ve experimented with fruit teas (tisanes) with mixed success. To my tastebuds, nothing comes close to Luzianne Iced Tea blend, but sadly I can’t get that in Canada.

Frozen Fudge Pops
When I saw this recipe I squealed and clapped my hands. Fudgesicles were a favourite childhood food, but this version with upgraded ingredients is definitely worth a try. Filing away for “things to do when I’m laid up after surgery.”


Screen shot of NYTimes photo


Possible Future Careers

  • Explosives technician 
  • Race car driver
  • Cupcake tester
  • Minor deity
  • Professional cynic
  • Gabourey Sidibe’s body double 
  • Lawn flamingo