Skip to content

Instantly share code, notes, and snippets.

@ulybu
Last active August 29, 2015 14:16
Show Gist options
  • Save ulybu/3c6995260b4d72be41e0 to your computer and use it in GitHub Desktop.
Save ulybu/3c6995260b4d72be41e0 to your computer and use it in GitHub Desktop.
Auto-login for Ledjamradio.com
function showLoginPopup(){
mMain.showPopup('popup_login');
}
function login(){
mMain.login();
}
function getInput(which){
var selector,
input;
switch(which){
case 'mail': selector = 'input#login_email';
break;
case 'password': selector = 'input#login_pwd';
break;
default : alert("t'as craque ton switch");
}
if(!(input=document.querySelector(selector))){
alert("echec de selector, z'ont change leur DOM");
} else {
return input;
}
}
function fillFields(){
// var mailInput = getInput('mail')
// , pwdInput = getInput('password')
// ;
getInput('mail').value = credentials.mail;
getInput('password').value = credentials.pwd;
}
var credentials = {
mail:'MAIL@EXAMPLE.com',
pwd: 'PASSWORD'
}
;
// Displaying the popup isn't necessary as we can call the login action directly
// (without simulating click event on the "Se connecter" button)
// showLoginPopup();
fillFields();
login();
@ulybu
Copy link
Author

ulybu commented Mar 3, 2015

What is it

This bookmarklet will log you on one click into http://www.ledjamradio.com/

Bookmarklet ?

Bookmarklets are tiny programs stored inside bookmarks.
Similar to add-ons, extensions, and user scripts, they add new tools to your web browser.
Bookmarklets are shared on web pages as web links.
You don't actually "install" a bookmarklet. You simply add it to your bookmarks. It just sits there patiently until you want to use it.

Install

  1. Copy the content of Ledjam auto-login in your text editor
    1. Click the RAW button (top of the file)
    2. crtl+A then crtl+C
  2. Modify the credentials variable with your own credentials. Copy the whole thing
  3. Go to http://ted.mielczarek.org/code/mozilla/bookmarklet.html
    1. Read instructions
    2. Put a name e.g. ladjam login, paste the code, crunch
  4. Drag the generated bookmarklet to your bookmark bar

Note: If your bookmark bar is hidden, google how to display it..

Usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment