Building a Twitter bot!

I have long admired – and, I’ll admit – been a bit fearful of cool technology projects that make use of APIs. To be honest, I’m still not *entirely* sure how an API works. It feels a bit like magic. You need keys and secret keys and bits of code and all those things need to be in the right place at the right time and I might even have to use scary things like the command line!

So you can imagine, I’ve been looking at all the cool Twitter bots launched over the past few years with much wistfulness… some examples of my favourites:

When I recently saw Andrew Booth’s tweet about his “Random Review Label Generator”, I knew it was time for me to get in on the action.

As it turns out, a lovely fellow has made the process of creating Twitter bots super easy by coding all the hard stuff and launching a user-friendly template with step-by-step instructions, freely available for anyone to use. Special thanks to Zach Whalen for creating and putting this online!

So: without further ado, I present to you a Twitter bot that randomly generates a new healthcare review project every hour. You’re welcome!

The beauty of this bot is that some of the project names are so ridiculous… any yet you wouldn’t be surprised to see many of them actually published. I am endlessly entertained by the combinations that it comes up with, and I hope you are too!

Advertisements

search twitter using boolean logic

Today’s tip is one of those ideas that seems obvious when you think about it, but many seem to overlook. While information professionals know to use boolean logic and nested parenthesis in formal databases, many have not thought to apply the same logic to social media sites or specialised search engines.

Case in point: Twitter!

Sure, you can search for a specific hashtag or user, but you can also combine these things together in complex ways. Let’s look at a few examples…

Example 1: Job searching

I’ve found complex twitter searching to be particularly useful when looking for vacant job postings (for myself and for others). Let’s say you’re looking for a position in the sustainability or environmental sector.

(sustainability OR environment OR environmental OR renewable OR clean OR energy) AND (#job OR #jobs OR #UKjobs OR recruit OR recruiting OR join OR vacant OR vacancy OR apply OR join)

See results of the search above here. 

From here, you can further narrow down your search to local jobs by clicking “near me” from the dropdown menu or include keywords for the locations you are interested in as a separate concept.

Example 2: I saw that thing on that feed but now I can’t find it!

Have you ever tried to find something on Twitter, and just scrolled continuously through a user’s tweets hoping that it will miraculously surface? Yeah, me neither…..

 

One way to find this elusive information is to use keywords in the search box along with a username. For example, maybe I remember some cool story about archival research in newspapers at Library of Congress.

@librarycongress newspapers

This search will find instances where Library of Congress has tweeted or have been mentioned in a tweet using the term newspapers:

screen-shot-2016-10-16-at-7-44-05-pm
Twitter search for “@librarycongress newspapers”

 

The above can also be nested within boolean logic and parenthesis.

Twitter, of course, wasn’t build for expert searching, so it’s far from a perfect interface. Some of the downsides include:

  • No truncation options
  • It’s difficult – if not impossible – to search systematically. Since Twitter is a proprietary platform and not necessarily transparent about the way its search interface works, it’s difficult to know exactly how it interprets your logic.
  • There’s no native ability to download results (although it can be accomplished through 3rd party programs).

Have you used Twitter for expert searching? Share your tips in the comments below, or contact me.