From 94b97eaf46cfafc3adb83fc7f943d515bb6a8b93 Mon Sep 17 00:00:00 2001 From: stevenaw Date: Tue, 25 Jan 2011 17:25:38 -0500 Subject: [PATCH] API Key configurable [#292] --- plugins/lastfm/popcorn.lastfm.html | 17 +++++++++++------ plugins/lastfm/popcorn.lastfm.js | 4 ++-- plugins/lastfm/popcorn.lastfm.unit.js | 9 ++++++--- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/plugins/lastfm/popcorn.lastfm.html b/plugins/lastfm/popcorn.lastfm.html index 5d0011d..0523c8e 100644 --- a/plugins/lastfm/popcorn.lastfm.html +++ b/plugins/lastfm/popcorn.lastfm.html @@ -5,7 +5,7 @@ - diff --git a/plugins/lastfm/popcorn.lastfm.js b/plugins/lastfm/popcorn.lastfm.js index fc8a0fc..fb54577 100644 --- a/plugins/lastfm/popcorn.lastfm.js +++ b/plugins/lastfm/popcorn.lastfm.js @@ -14,7 +14,7 @@ var lastFMcallback; * appended to, this target element must exist on the DOM * * @param {Object} options - * + * * Example: var p = Popcorn('#video') .lastfm({ @@ -61,7 +61,7 @@ var lastFMcallback; var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); - script.src = "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist="+ options.artist +"&api_key=30ac38340e8be75f9268727cb4526b3d&format=json&callback=lastFMcallback"; + script.src = "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist="+ options.artist +"&api_key="+options.apikey+"&format=json&callback=lastFMcallback"; script.type = "text/javascript"; head.insertBefore( script, head.firstChild ); diff --git a/plugins/lastfm/popcorn.lastfm.unit.js b/plugins/lastfm/popcorn.lastfm.unit.js index 092984d..f319dd3 100644 --- a/plugins/lastfm/popcorn.lastfm.unit.js +++ b/plugins/lastfm/popcorn.lastfm.unit.js @@ -28,19 +28,22 @@ test("Popcorn LastFM Plugin", function () { start: 1, // seconds end: 4, // seconds artist: 'yacht', - target: 'lastfmdiv' + target: 'lastfmdiv', + apikey: '30ac38340e8be75f9268727cb4526b3d' } ) .lastfm({ start: 2.5, // seconds end: 7, // seconds artist: 'the beatles', - target: 'lastfmdiv' + target: 'lastfmdiv', + apikey: '30ac38340e8be75f9268727cb4526b3d' } ) .lastfm({ start: 4.5, // seconds end: 7, // seconds artist: '', - target: 'lastfmdiv' + target: 'lastfmdiv', + apikey: '30ac38340e8be75f9268727cb4526b3d' } ); interval = setInterval( function() { -- 2.43.0