Twitter Music Trends

From Music Hack Day

Jump to: navigation, search

Contents

[edit] Creator


[edit] About the hack

Is the music industry's publishing schedule being tied to an archaic publisher's schedule getting you down?

Are weekly charts impossibly old news?

Do you need to know what is going on right now around the world in order to drive your own listening habits?

Try Twitter Music Trends!

We take real time updates from Twitter, extract the artists people are talking about right now, and present it to you in a delightfully retro interface!

[edit] How it works

The back end makes a connection to Twitter's HTTP Streaming API, looking for key hashtags and other indicators of music (#nowplaying in the demo). Each tweet is passed to the Echo Nest's new Artist Extraction API (via a small phalanx of back-end workers) in order to get a bunch of candidate Artists estimated to be included in the tweet. After filtering out common words, short words, and twitterisms, the worker decides on a best candidate and enters it into the back end store.

+-------------------------------+       +----------------+
|  Twitter Streaming API Reader |       |                |
|-------------------------------|       |                |
|                               |<-----+|   Twitter      |
|                               |       |                |
|                               |       |                |
|                               |       |                |
+-------------------------------+       +----------------+
     +          +           +
     |          |           |
+----v---+  +---v----+  +---v----+      +----------------+
| Worker |  | Worker |  | Worker |      |                |
|--------|  |--------|  |--------|      |                |
|        |  |        |  |        |+---->|  Echo Nest     |
|        |  |        |  |        |      |  Artist/extract|
|        |  |        |  |        |      |                |
+--------+  +--------+  +--------+      +----------------+
     +          +            +
     |          |            |
     +--->------v-------<----+   +--------------------+
         |Redis Storage |        |  Web server        |
         |--------------|        |--------------------|
         |              |        |                    |
         |              |<------+|                    |
         |              |        |                    |
         |              |        |                    |
         +--------------+        +--------------------+

The user interface is handcrafted in delightfully retro HTML, with syntax that would make a HTML5anaut cry. AJAX? Comet? WebSockets? No. We use http meta-refresh.

You can get an overall graph of the leaders on Twitter (2Pac rules them all by a wide margin), a real-time view of the detected artists as they come in, and the latest trends where the most recently tweeted artists are scaled by their overall strengths. You get a view on the latest trends, and who is being played most right now. You can click on any of the artists to get a view on their (up to 10) latest tweets.


[edit] Images/Screenshots

overall.png latest.png katie.png trend.png

[edit] Source code and links

  • localhost
  • GitHub soon!

[edit] What APIs, tools or kit did you use?

  • Echo Nest Extract Artist API
  • Twitstream
  • Redis
  • Python, with Redish, Celery, Flask

[edit] Anything left to do

Sure... There's a load that could be done with it:

  • Attractive, modern output.
  • Better detection of stopwords and matching with tweets.
  • Expanding the watch-triggers (beyond #nowplaying).
  • Wanted to hook into Sonar schedule, but people are not tweeting with enough velocity to get meaningful data.
  • Trivial to get playlists from trend data.
Personal tools