Request a free site audit

Need help with your digital news operation?

Life news: I got a dog


Elsewhere on the Web

On using Google’s Perspective API to police the tone of my tweets

A couple weeks ago, Google gave me access to their Perspective API, which can programmatically detect tone from a string of words.

I’m the first to admit that tone can be a problem for me (I get excited easily) so I was gung-ho to see how I could use the tool.

It’s surprised me a few times, and caused me to delete a couple tweets. One was this morning about the opioid epidemic. Sometimes I need the reminder that not everyone feels things as passionately as I do.

One implementation detail I’d handle differently next time is using an API other than the timeline endpoint. This would let me use an account other than @davisshaver to search my tweets and send out the nag. As it stands, it looks like I’m replying to myself. Not to mention, the threading doesn’t seem quite right.

Here are some example tweets that got flagged. This marks the end of my little experiment, at least publicly. I‘m going to switch to direct messages in the next few days. The hack has proven useful enough that I want to keep it, but not so useful that I want you all to see it.

Here’s what my log output looks like.

Update June 30: I changed my mind on switching to direct messages, mainly because the notifications were funky (read as: nonexistent) when I DM’ed myself. I also tweaked the implementation to address the bugs mentioned above (now struck through). Introducing my bot!

Here’s the code, tell me how bad (or… good?) it is in the comments.


Did you enjoy this post?

Signup to receive a weekly email containing my new posts, curated links, and book reviews.

Thank you for subscribing.

Something went wrong.


Follow me on Twitter

The past, present, and future of making the WordPress Editor work for editors

Presented originally in 2017 at WordCamp Baltimore and adapted for this weekend’s WordCamp Lancaster.


The people you meet at WordCamp

Last weekend I presented at WordCamp Lancaster and had a great time. When I did this last time, I wrote about driving route 30 (the historic Lincoln Highway), but this year I wanted to spotlight a few other attendees, as it’s the people that make WordCamp worth attending. And really, it’s the people that make WordPress and other open source communities so special.


Send this to a friend