You need a cookie
February 14th, 2012
I’ve just published my first NPM package, and it’s called musixmatch. With this library you can easily use the musiXmatch API with a few lines of javascript.
Install it with NPM:
npm install -g musixmatch
And here an example:
var util = require("util"); var mXm = require("musixmatch"); mXm.Config.API_KEY = "YOUR_API_KEY"; var successCallback = function(modelOrCollection) { console.log("Success:"); console.log(" " + util.inspect(modelOrCollection)); }; var errorCallback = function(response) { console.log("Error callback:"); console.log(" " + util.inspect(response)); }; mXm.API.getTrack(TRACK_ID, successCallback, errorCallback); mXm.API.getLyrics(LYRICS_ID, successCallback, errorCallback); mXm.API.getArtist(ARTIST_ID, successCallback, errorCallback); mXm.API.getAlbum(ALBUM_ID, successCallback, errorCallback); mXm.API.getSubtitle(TRACK_ID, successCallback, errorCallback); mXm.API.searchTrack({q: QUERY}, successCallback);
If you want you can set your musiXmatch API KEY as an environment variable, and you won’t need to set it in your code:
export MUSIX_MATCH_API_KEY="YOUR_API_KEY"
You can find the source code on github.
The new version of web-app-theme finally supports Rails 3. Check out the repository on github. It also supports Haml template generation using html2haml, like devise does.
UPDATE: the version 0.6.2 fixes a bug in the Haml generation when you use form_for blocks.
If you want to search for lyrics and tracks with Ruby using the musiXmatch API, check out my repository at http://github.com/pilu/musix_match
I’m working on a simple game for iPhone based on cocos2d. Yesterday I installed it on my old iPhone3G and it was veeeeeeeery slow. After a lot of refactoring I found a NSLog call inside my game loop. It basically logged all the collision detection of the player with all the tiles in the map. After removing that it’s even faster then before. So, if you want to log something, do it, but remember to remove all these logging calls later.