Hack Forums
[Userscript] Award Whore - Add awards to your own profile with ease - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Computing (https://hackforums.net/forumdisplay.php?fid=88)
+---- Forum: Computing Lounge (https://hackforums.net/forumdisplay.php?fid=8)
+---- Thread: [Userscript] Award Whore - Add awards to your own profile with ease (/showthread.php?tid=3568749)

Pages: Pages 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20


Award Whore - Add awards to your own profile with ease - 'Snorlax - Jun 22, 2013

PHP Code

<?php 
// ==UserScript==
// @name      Hack Forums Award Whore v2
// @namespace      Snorlax
// @description     Adds awards to your profile
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @grant      GM_setValue
// @grant      GM_getValue
// @grant      GM_deleteValue
// @include      *hackforums.net/*
// @version      1.0.2
// ==/UserScript==

uid = $("#panel").find('a').attr('href').replace(/[^0-9]/g, '');
array = [];
if(
GM_getValue("awards") != undefined) {
    array = 
JSON.parse(GM_getValue("awards"));
}
if(array == 
undefined){
    array = [];
}

if(
GM_getValue("awards") != null){
    for (var 
i=0;i<array.length;i++){
      $(
'a[href="https://hackforums.net/member.php?action=profile&uid='+uid+'"]:not(:first)').parentsUntil('tbody').find('.post_author_info').find("span:last").append('<img src=' + array[i] + ' />');
    };
}

if(
location.href == 'https://hackforums.net/myawards.php'){      
    $(
".thead").append('<button style="float: right;" onclick="javascript:return false;" class="button reset">Reset awards</button>');
    $(
".thead").append("Displaying current awards: ");
    for (var 
i=0;i<array.length;i++){
      $(
".thead").append('<img src=' + array[i] + ' />');
    };  

    $(
"td[class*='trow'] img").click(function(){
      $(
this).fadeTo('fast','0.2');
      array.
push($(this).attr("src"));
      
GM_setValue("awards", JSON.stringify(array));
      
console.log(array);
      
console.log(GM_getValue("awards"));
    }); 

    $(
".reset").on("click", function() {
      
GM_deleteValue("awards");
      array = [];
      $(
this).text("Awards has been reset");
      
$this = $(this);
      
interval = setInterval(function() {
      
$this.text("Reset awards");
      
clearInterval(interval);
      }, 
5000);
    });
} 

For Firefox get GreaseMonkey.
For Chrome get TamperMonkey.
For other browsers: Get Chrome.

What it does:
It adds any award you like to your profile! Client side of course, so it only works on your screen, and not others.
When you go to https://hackforums.net/myawards.php you simply press on the image of each award you want, then it will add it to your profile. You can also find that link at the bottom of the page. The text says "Awards".

[Image: 3lzfO.png]

This only works on people who has NOT set their browsing experience to "Display posts in classic mode." - You can change that here, but if you didn't change it, then it should work. Classic mode is ticked, you need to untick it.

Thanks to my good friend The Don Killuminati for giving me this idea!

­

==­===­===­=
Known bugs:

  1. When you post a new reply, the awards won't get added. Deal with it. Refresh the page and they're there.
  2. Another "bug" - You can add multiple awards by clicking on them more than once. For people who want to be a bigger whore!



* - Wonders - Jun 22, 2013

This is pretty nice, thanks for the share.

Spoiler (Click to View)


* - 'Snorlax - Jun 22, 2013

You're welcome, Wonders! If you find any bugs, please report them to me.
I will have this moved out of Empire's SF once everything is done ;)


* - Pray - Jun 22, 2013

Haha, that's actually pretty cool. Thanks for sharing and making this! :)

I think this may be a bug: I cannot edit my post. But I can when I right click and open it on a new tab.


* - Emylbus - Jun 22, 2013

Very well done, Snorlax! I especially enjoy the award fading. :D

(Jun 22, 2013 05:21 AM)Chieftain Wrote:  I think this may be a bug: I cannot edit my post. But I can when I right click and open it on a new tab.

I'm not having that issue


* - 1n9i9c7om - Jun 22, 2013

That's pretty cool. :)
[Image: eywodzd.png]

🤣


* - 'Snorlax - Jun 22, 2013

I'm glad you liked it guys. This is why I do this.. To get better, and get lots of love! =D


* - Verts - Jun 22, 2013

Thanks for the share! Mind try it out later :P


* - Alpha Bruh - Jun 22, 2013

Pretty cool user script :P I'm going to try it out now!


* - 1n9i9c7om - Jun 22, 2013

(Jun 22, 2013 05:27 AM)Snorlax Wrote:  I'm glad you liked it guys. This is why I do this.. To get better, and get lots of love! =D

Now make it working with a server so everybody who use this userscript will see the changes from other people who use that too!

Just kidding, but I love the idea of making a script which allows you to edit the awards 😝


* - Alpha Bruh - Jun 22, 2013

Blah my awards are not showing up for some reason :/


* - 'Snorlax - Jun 22, 2013

(Jun 22, 2013 07:15 AM)1n9i9c7om ツ Wrote:  Now make it working with a server so everybody who use this userscript will see the changes from other people who use that too!

Just kidding, but I love the idea of making a script which allows you to edit the awards 😝

Nah, that would require too much work, and I'm not really into making a server and load external site stuff.
But yeah, what do you mean with edit? Like it is now, or add custom ones? 😝


* - 1n9i9c7om - Jun 22, 2013

(Jun 22, 2013 07:23 AM)Snorlax Wrote:  Nah, that would require too much work, and I'm not really into making a server and load external site stuff.
But yeah, what do you mean with edit? Like it is now, or add custom ones? 😝

I meant it like it's now, but your idea is even better 🤣


* - 'Snorlax - Jun 22, 2013

(Jun 22, 2013 07:23 AM)Shreddah Wrote:  Blah my awards are not showing up for some reason :/

That's odd.
Which browser do you use?


* - Tutelary - Jun 22, 2013

Now I can finally put the RAT Expert award on my profile. Thanks for this.