@seevl’s DJ, Twitter, and the Semantic Web

As most of my side projects, “seevl DJ” started as a quick hack on a sunday afternoon. Yet, it has been quickly picked and featured on Fast Company and Hypebot, and also got some attention on Twitter itself.

With a little help from my friends

I’ve spend some time improving it so you can use additional commands, e.g. “a song by”, “play me something like”. In addition, it now uses the Freebase / YouTube mappings combined with the seevl API in order to find an artist’s videos (when using a genre / label / related query).

Last but not least, you can now use “/cc @user” and “for @user” in your Tweet to send a track to any of your friend, the music video being available directly on their feed through Twitter cards (Web and mobile).

Services, actions, and payments on Twitter

Thinking again about Twitter as an intelligent agent on the Web, let’s be bold and imagine this integrated with the buy / Stripe integration. While it’s now used to buy stuff, what about paying for services with it? “Hey @uber, bring @myfriend here”. “Hey @trycaviar, sushis for 6 please”. Both answering with an automated tweet embedding a Buy button so you can validate the order; and get your black car or food home within minutes. All through Twitter.

Natural Language Processing is one way to enable this, but another one is to pre-fill such “service-based tweets” so that users would just have to complete a few fields (e.g. number of people when messaging @opentable). This makes things much easier from the processing side, also providing a friction-less experience to users. Technically, the intelligence can be brought by schema.org actions, as I’ve wrote in the past, using JSON-LD as the supporting data serialisation.

A similar approach is used in Gmail (see for instance the Github integration). So, Twitter, what’s your next move to also embrace the Semantic Web?

Remove inactive Twitter followees with this tiny Python script

I recently reached the Twitter limit to add new followees so I’ve wrote a tiny Python script, Twitter Cleaner, to remove people who haven’t send anything for a number of days (30 by default) – and consequently be able to add new ones. It’s now available on github.

Twitter Cleaner

Twitter Cleaner

Note that it might conflict with the previous Twitter TOS if you unfollow too many people at once. However, it will happen only once if you put it into a daily crontab. It was safe in my case, but I can’t guarantee it will be in yours. You may also reach the API rate-limiting if you’ve too many followees.

It’t built using python-twitter, and is available under the MIT license.

 

Last night a DJ saved my life: What if Twitter could be your own DJ?

While the Twitter music app eventually failed, it’s still clear that people use Twitter’s data stream to share and/or discover new #music. Thanks to Twitter cards, a great thing is that you can directly watch a YouTube video, or listen to a SoundCloud clip, right from your feed, without leaving the platform. But what if Twitter could be your own DJ, playing songs on your request?

Since it’s been a few month since I enjoyed my last Music Hack Day – oh, I definitely miss that! – I’ve hacked a proof of concept using the seevl API, combined with the Twitter and the YouTube ones, to make Twitter acts as your own personal DJ.

Hey @seevl, play something cool

The result is a twitter bot, running under our @seevl handle, which accepts a few (controlled) natural-language queries and replies with an appropriate track, embedded in a Tweet via a YouTube card. Here are a few patterns you can use:

Hey @seevl, play something like A

To play something that is similar to A. For instance, tweet “play something like New Order”, and you might get a reply with a Joy Division track in your feed.

Hey @seevl, play something from L

To play something from an artist signed on label L (or, at least, that used to be on this label at some stage)

Hey @seevl, play some G

To play something from a given genre G

Hey @seevl, play A

To simply play a track from A.

By the way, you can replace “Hey” by anything you want, as long as you politely ask your DJ what you want him to spin. Here’s an example, with my tweet just posted (top of the timeline), and a reply from the bot (bottom left).

Twitter As A DJ

Twitter As A DJ

A little less conversation

As it’s all Twitter-based, not only you can send messages, but you can have a conversation with your virtual DJ. Here’s for instance what I’ve sent first

And got this immediate reply – with the embedded YouTube video

Followed by (“coo” meant to be “cool”)

To immediately listen to Bettie Smith in my stream

It’s kind of fun, I have to say, especially due to the instantaneous nature of the conversation – and it even reminds IRC bots!

Unfortunately, it’s likely that the bot will reach the API rate-limit when posting Tweets (and I’m not handling those errors in the current MVP), so you may not have a reply when you interact with it.

Twitter As A Service?

Besides the music-related hack, I also wanted to showcase the growth of intelligent services on the Web – and how a platform like Twitter can be part of it, using “Twitter As A Service” as a layer for an intelligent Web.

The recently-launched “Buy button” is a simple example of how Twitter can be a Siri-like interface to the world. But why not bringing more intelligence into Twitter. What about “Hey @uber, pick me in 10 minutes”, and using the Tweet geolocation plus a Uber-API integration integration to directly pick – and bill – whoever #requested a black car? Or “Please @opentable, I’d love to have sushis tonight”, and get a reply with links to the top-rated places nearby, with in-tweet booking capability (via the previous buy button)? The data is there, the tools and APIs are there, so…

Yes, this sound a bit like what’s described in the seminal Semantic Web article by Tim Berners-Lee, James Hendler and Ora Lassila. Maybe it’s because we’re finally there, in an age where computers can be those social machines that we’re dreaming about!

 

A proposal for Semantic OMB

From what I read on Twitter, it seems there’s a bit of confusion regarding SMOB. Indeed, while SMOB provides a framework for Open and Semantic Microblogging, it does not define a new protocol, but simply uses SPARQL/Update over HTTP to exchange information between hubs (posting / removing notices and following / followers). Hence, this is not something that competes against OMB, the OpenMicroBlogging specification.

Actually, OMB is something we planned to look at for a long time, as briefly discussed when Status.net / OMB was presented in the W3C Social Web XG telco. I’ve finally took the time to analyse the full spec and checked how it compares with the distributed microblogging implementation of SMOB, and more generally with the vision of Semantic Web / Linked Data (SW/LD) microblogging services.

So here is a proposal for “Semantic OMB” (on Status.net wiki) that describes how the current OMB protocol fits with the previous idea. In particular, it aligns the terminology with existing classes / properties from well-known ontologies, and discusses how some current parts of the spec should be updated. It also discuss how OMB operations can be mapped to SPARQL/Update queries, based on the ones that currently happen in SMOB for cross-hubs synchronisation.

As you can see when browsing it, besides the terminology mappings, most of the things are compliant and there are only a few things that shall be discussed, in order to:

  • enable a better “distributed-ness” by keeping profiles owned by their users and not necessarily creating remote accounts;
  • making some mandatory elements being optional, as they are contained in the data that is exchange between services thanks to the Linked Data principles.

Thanks to these small updates, it could provide a protocol enabling SW/LD systems to be designed based on the OMB protocol, while having a sufficient abstraction level to comply with OMB systems using other technologies for data modeling and exchange. I’d be more than happy to see such features in an upcoming OMB release, and hopefully see deeper links between OMB and SW/LD efforts, as both aims to achieve the same goal of openness and interoperability. Comments and feedback are welcome on the related thread on the OMB mailing-list.

SMOB v2.1: Using SMOB as a Twitter client

Here’s a new release of SMOB, the Semantic MicrOBlogging framework. This release includes various new features, the main one being the integration of Twitter messages in SMOB so that you can use your SMOB hub as a Twitter client, where each Tweet is represented in RDFa using SIOC, FOAF, etc.

In addition, the new release provides:

  • RSS feed for hub owner’s messages;
  • Automatic @reply when replying to a Twitter message (including sioc:addressed_to annotation);
  • Updated user-interface for #tags mappings, now done using tabs to avoid too much scrolling;
  • Ability to directly check @reply messages;
  • Starring system using the Review vocabulary.

SMOB v2.1 can be downloaded here. If you used a previous version, you will also need to apply this patch after the update. It may remove some of your following / followers (as there have been some changes in the related RDF data – this should be taken into account by the patch, but who knows …), in that case you’ll add to add them again, sorry for the inconvenience !

Hopefully, a 2.2 release will be out in the next weeks, including geolocation of messages, advanced browsing features and other funky improvements. Feature requests can also be suggested on its dedicated bugtracker.

SIOC-based microblogging

As John Breslin already detailed last week, we (Tuukka Hastrup, Uldis Bojars, John and myself) recently work on SMOB, a semantic microblogging architecture, that will be presented at next SFSW workshop, co-located with ESWC in Tenerife.

While there have been a lot of buzz recently regarding ways to provide open alternatives to Twitter, then fun thing is that we worked on this in last January while I visited DERI. Our main goal was to show how Semantic Web technologies could provide an open-platform for such way of publishing content, mainly using FOAF and SIOC. Moreover, one of our aim was also to demonstrate how such technologies can provide users a way to control, share and remix their data as they want, not depending on a third-party service, a goal also shared by the dataportability project. In that way, SMOB-published data really belongs to the user that wrote it. Indeed, while SMOB servers (which display a faceted view of agregated posts as you can see on the demo server) store data in their local triple-store, this information (i.e. each update) is hosted on the client side and available in RDF.

At the moment, the complete updates dataset is public, and can be browsed with any RDF browser as the picture below shows (with Tabulator) but we plan to introduce more advanced authentication and privacy issues, in which OpenID could have a role to play.

smob-rdf.png

Users can parse it as any RDF data, mash-it up with other information, eg their FOAF profile (SMOB allows to re-use existing FOAF profile as the foaf:maker of each update), or any other RDF data. And most important, if a SMOB server closes, they still own their data.

Moreover, since SMOB content is SIOC-based, it becomes part of the SIOC-o-sphere, and could be merged with your other social media contributions (from any SIOC application) and discovered thanks to recent APIs and WordPress plug-in introduced by Sindice (automatic PTSW / Sindice pings will be soon in the code repository). This is one more advantage of getting a common semantics to model your data wherever they come from.

smobsphere.png

Finally, we just introduced in SMOB a way to publish not only to a dedicated server, but also to Twitter. So that you’ll get a real-time, self-hosted and long-life archive of your twits in RDF. Isn’t that cool ?

smob-tw.png