The rainy saturday afternoon project: Soundblog.
While riding my bike, programming or editing photos I like to listen to music on Soundcloud. In the last year or so, Soundcloud actually became my primary music source.
I like DJ sets of about 40-120 minutes length and I discover cool stuff almost every day. So why not blogging it :)
So how does it work? You execute
post.py with the Soundcloud track URL, like this.
The script will query the Soundcloud API and generate a Jekyll post file with the current date and the tracks original permalink.
The post has no content but an additional attribute
--- layout: post title: "Alle Farben - 45 (Winterheart Blue)" date: 2014-08-02 18:43:47 +0200 track_id: 134448167 ---
The track ID is used in the template to generate the Soundcloud embed code.
<iframe width="100%" height="550" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/134448167&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true"></iframe>
The title, permalink, and track_id are retrieved from the Soundcloud API. But the date is the current date. You can
specify another posting date by using the second script parameter that takes a
YYYY-MM-DD date. This uses the
specified date in the file name and post date but sets the time to 13:00:00.
Also, the date contains the UTC offset so the date is processed correctly by Jekyll.
So that’s it. All you have to do is call a script with a Soundcloud URL to create a post. I think this could also be interesting for podcasters. Although I don’t know if a lot of podcasters upload to Soundcloud.
Currently only Soundcloud posts are supported. But adding another services such as Mixcloud is absolutely possible.
And this is my sound blog: http://tunnelmusik.github.io.