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.
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).
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
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…
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.
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;
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.
Any status update posted to Twitter from a SMOB client now features a ‘from SMOB’ link, a good way for semwebbers to promote it.
A v0.1 release is planned soon, but if you already want to use it, just get the latest svn version.This one also features the firsts steps of RDFa integration in the client homepage, as you can see there.
While there have been alotofbuzz 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.
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.
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 ?