Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 2 of 2
  1. #1
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default js helpp [greasemonkey ext]

    Ok basically the smilies on bebo are peeing me off.
    So i started writing this greasemonkey script to replace them with nicer ones

    But it doesnt work..

    "permission denied to call method Location.toString"
    "missing ) after argument list"

    heres code i got
    Code:
    // ==UserScript==
    // @name    Bebo Smilies
    // @namespace    http://www.mrcraig.net
    // @description    Converts bebo smilies into more visually appealing ones
    // @include    http://www.bebo.com/*
    // ==/UserScript==
    
    var str = document.getElementById("content_Comment").innerHTML;
    
    var str = str.replace("<img src="http://s.bebo.com/img/smiley_wink.gif" alt=";)" />","");
    
    document.getElementById("content_Comment").innerHTML = str;
    Any help please?

    Im only trying to replace the wink smilie with blank to try this out before i do all of them

    Thankyou
    Craig.

    Edit by Robbie! (Forum Moderator) - Moved to Coding Help. Please post in the correct section next time, thanks
    Last edited by Robbie; 15-02-2009 at 02:59 PM.
    Coming and going...
    Highers are getting the better of me

  2. #2

    Default

    Let me start off by saying I wish there was a cleaner way to do this like using an array of searches and replaces much like in PHP, but unfortunately I couldn't find one. Secondly this script isn't exactly what you wanted, although it does replace smileys with nothing, it is intended for you to fill out the new urls for each smiley and then it'll replace them. Otherwise I could of made a much shorter smiley to remove it all. Anyway, here it is enjoy.

    Code:
    // ==UserScript==
    // @name          Bebo Smilies
    // @namespace     http://www.mrcraig.net
    // @description   Converts bebo smilies into more visually appealing ones.
    // @include       http://www.bebo.com/*
    // ==/UserScript==
    
    var comments = document.getElementById('content_Comment').innerHTML;
    
    /* The Original Smileys */
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley.gif"[^>]*>/g, '');                  // Happy Smiley
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_sad.gif"[^>]*>/g, '');              // Sad Smiley
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_big_grin.gif"[^>]*>/g, '');         // Grinning Smiley
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_oh.gif"[^>]*>/g, '');               // Oh Smiley
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_ohmygod.gif"[^>]*>/g, '');          // Oh My God Smiley
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_laugh.gif"[^>]*>/g, '');            // Laughing Smiley
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_wink.gif"[^>]*>/g, '');             // Winking Smiley
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_grrr.gif"[^>]*>/g, '');             // Angry Smiley
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_sleep.gif"[^>]*>/g, '');            // Sleepy Smiley
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_toungeout.gif"[^>]*>/g, '');        // Tounge Out Smiley
      
    /* The Extra Smileys */
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/bebosummer.gif"[^>]*>/g, '');      // Bebo Summer
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/gold.gif"[^>]*>/g, '');            // Gold Medal
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/silver.gif"[^>]*>/g, '');          // Silver Medal
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/bronze.gif"[^>]*>/g, '');          // Bronze Medal
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/mobile\/mobileB.gif"[^>]*>/g, '');         // Mobile Bebo
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/skittles-green.gif"[^>]*>/g, '');  // Skittle (Green)
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/skittles-yellow.gif"[^>]*>/g, ''); // Skittle (Yellow)
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/skittles-orange.gif"[^>]*>/g, ''); // Skittle (Orange)
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/skittles-pink.gif"[^>]*>/g, '');   // Skittle (Pink)
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/skittles-red.gif"[^>]*>/g, '');    // Skittle (Red)
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/skittles-purple.gif"[^>]*>/g, ''); // Skittle (Purple)
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/4leafclover.gif"[^>]*>/g, '');     // Four Leaf Clover
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_bebo.gif"[^>]*>/g, '');             // Bebo
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/rednose.gif"[^>]*>/g, '');         // Red Nose
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/jack-o-lantern.gif"[^>]*>/g, '');  // Jack-O-Lantern
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley\/cupid.gif"[^>]*>/g, '');           // Cupid
    var comments = comments.replace(/<img.*src="http:\/\/s.bebo.com\/img\/smiley_moon.gif"[^>]*>/g, '');             // Smiley Mooning
    
    document.getElementById('content_Comment').innerHTML = comments;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •