LastSlacker » Discussions

Firefox Extension ?

 
  • Firefox Extension ?

    I think the ability to integrate slacker with lastfm is great, thank you.

    I'm wondering though, if there is word on whether an extension is in the works too?

    The pandora ext is very convenient and handy(with features & options), it would be great to also have a similar slacker ext, imo.

  • I'm not currently working on anything, but I'm sure its possible.

    Most of the heavy-lifting for lastSlacker is done with client-side javascript, so my guess is a Firefox extension could reuse much of this code. I don't have much motivation to do this however, because I prefer being able to support most modern browsers.

    The server side is actually pretty simple. All it does is take simple requests from the javascript client, and handle the communication protocol with last.fm. There isn't much of a security concern regarding passwords, because the client-side javascript handles encrypting your password based on session data received from last.fm, so your real password never leaves your browser, and lastSlacker.com has no way of figuring out what it is.

    Because Slacker is javascript based rather than flash based like pandora, I was able to more tightly integrate last.fm support. For this reason, I don't think there is as big a need for an extension as you don't have to do cumbersome things like log-in to pandorafm in order to use it anyway. Perhaps a greasemonkey script to automatically load lastSlacker and log you in to last.fm whenever you visit slacker.com would make the process even more seamless... Maybe somebody with some greasemonkey experience wouldn't mind whipping this up...

    • weunice said...
    • User
    • 4 Apr 2008, 16:17
    I would think it possible to make this a Greasemonkey script in short order ...

  • I haven't tried this yet, but a lastSlacker user by the name of Kevin whipped this up:
    --------------------------

    Very simple. Copy in-between the ######### lines and name the file lastslacker.user.js
    Install Greasemonkey. Install this js then you don't need to run the bookmark.


    #############################################


    // ==UserScript==
    // @name Slacker Last.fm
    // @namespace http://lastslacker.com
    // @description Hide everything but the slacker tuner.
    // @include http://www.slacker.com/
    // ==/UserScript==



    window.addEventListener(
    'load',
    function() {
    var bootstrap = document.createElement('script');
    bootstrap.setAttribute('src', 'http://lastslacker.com/slacker/client/bootstrap.js?lastfm=1');
    bootstrap.setAttribute('type', 'text/javascript');
    var head = document.getElementsByTagName('head')[0];
    head.appendChild(bootstrap);
    },
    true);

    ########################################################

    • weunice said...
    • User
    • 8 Apr 2008, 15:52
    Works in Firefox 2 for me ... I tried it in Firefox 3 and it locks up. I have been using Firefox 3 for a while. This working in 2 is incentive enough for me to back off it for a while. Maybe I should see if there is a new version of Greasemonkey for Firefox 3... Ill report back if that solves it for Firefox 3

    Edited by weunice on 8 Apr 2008, 20:43
    • weunice said...
    • User
    • 8 Apr 2008, 16:03
    OK, tried it in Firefox 3 beta 5 with Greasemonkey 0.8.20080121.0 and it still locks up

    From what I can tell Firefox 2 is the way to go here. Thanks to all.

  • Interesting, I haven't upgraded to Firefox 3 yet. If there is a problem with greasemonkey, I'm sure it will be fixed soon since it is so popular.

    • tanis22 said...
    • User
    • 18 Jun 2008, 19:23

    Ok updated to FF3 and the issue seems to not know DOM load

    here is the update/workaround:
    ############################
    // ==UserScript==
    // @name Slacker Last.fm
    // @namespace http://lastslacker.com
    // @description Hide everything but the slacker tuner.
    // @include http://www.slacker.com/
    // ==/UserScript==



    window.addEventListener(
    'load',
    function() {


    checkLoad();
    var bootstrap = document.createElement('script');
    bootstrap.setAttribute('src', 'http://lastslacker.com/slacker/client/bootstrap.js?lastfm=1');

    bootstrap.setAttribute('type', 'text/javascript');

    var body = document.getElementsByTagName('body')[0];

    body.appendChild(bootstrap);


    },

    false);

    function checkLoad(){

    if(document.getElementById("player")){
    alert('Wait for the Loading Radio Stations.... Then Click OK');
    return true;
    }else{
    checkLoad();
    }

    }
    ####################################

    • Zampa said...
    • User
    • 25 Jun 2008, 12:45

    Re: Ok updated to FF3 and the issue seems to not know DOM load

    This works great! Thank you very much!

  • Here is the FF3 code that auto places it after 10 seconds (no alert box). Feel free to change the 10000 to a higher number if you are on a slow connection.

    ####################################
    // ==UserScript==
    // @name Slacker Last.fm
    // @namespace http://lastslacker.com
    // @description Hide everything but the slacker tuner.
    // @include http://www.slacker.com/
    // ==/UserScript==


    window.addEventListener(
    'load',setTimeout(
    function() {



    var bootstrap = document.createElement('script');
    bootstrap.setAttribute('src', 'http://lastslacker.com/slacker/client/bootstrap.js?lastfm=1');

    bootstrap.setAttribute('type', 'text/javascript');

    var body = document.getElementsByTagName('body')[0];

    body.appendChild(bootstrap);





    },10000),

    false);
    ####################################

  • lol they made the extention work for last.fm now.....






    (((***** Don't judge a book by it's cover, judge it by it's content inside. *****)))
Anonymous users may not post messages. Please log in or create an account to post in the forums.