Since the like button was such a success (78 likes and counting,) I decided to make a BBCode tag for it.
Like Button
[likebtn ]site_to_like[/likebtn ]
Remove the spaces in the BBCode tags.
Also...
The Like Counter
[likecount ]site_to_like[/likecount ]
Again, remove the spaces in the BBCode tags.
Download here: http://dl.dropbox.com/u/69615840/liketag.user.js
EDIT: now like this post!!!
[center]
[likebtn]http://scratch.mit.edu/forums/viewtopic.php?id=94541[/likebtn]
[likecount]http://scratch.mit.edu/forums/viewtopic.php?id=94541[/likecount] people like this post.
[/center]
Last edited by GeonoTRON2000 (2012-04-11 10:15:07)
Offline
jvvg wrote:
I've always been wondering: how do you make a .js file into a browser extension? I only know how to make a Chrome .crx file.
Is there a tutorial or something?
It's called a userscript. You end it with .user.js.
// ==UserScript== // @name Script name // @namespace Not sure... // @description Short description // @include http://google.com/ (only on google.com homepage) // @include http://*.google.com/ (only on anything.google.com homepage) // @include http://*.google.com/* (anything on anything.google.com) // @include http://*.google.tld/* (anything on anything.google.anything) // @exclude http://mail.google.tld/* (don't run on GMail) // ==/UserScript== // Regular old JavaScript code goes here.
Offline
jvvg wrote:
Is there a tutorial or something?
Here's an example of how to make your own BBCodes with a UserScript (this is my antidote script):
// ==UserScript== // @name Scratch Forums Image Fix // @namespace GeonoTRON2000,Scratch // @description Turns [img] BBCode tag into an image // @version 1.6.0.0 // @include http://scratch.mit.edu/forums/* // @include http://scratch.mit.edu/tbgforums/* // ==/UserScript== // get a copy of the page html var thishtml = document.body.innerHTML; // define your opening and closing tags (regular expressions with global modifiers) var open = /\[img\]/g; var close = /\[\/img\]/g; var flashopen = /\[flash\]/g; var flashclose = /\[\/flash\]/g; var ytopen = /\[youtube\]/g; var ytclose = /\[\/youtube\]/g; var sopen = /\[scratch=flash\]/g; var sclose = /\[\/scratch\]/g; var nothere = /antidoteexists=false/g; var forumlink = /http:\/\/scratch.mit.edu\/forums\/viewtopic.php\?id=85229/g; // replace your tags with HTML thishtml = thishtml.replace(open, "<img onload=\"\" src=\""); thishtml = thishtml.replace(close, "\" style=\"max-width: 510px;\" />"); thishtml = thishtml.replace(flashopen, "<embed type=\"application/x-shockwave-flash\" style=\"max-width: 510px;\" src=\""); thishtml = thishtml.replace(flashclose, "\"></embed>"); thishtml = thishtml.replace(ytopen, "<iframe style=\"max-width: 510px;\" width=\"560\" height=\"315\" src=\"http://www.youtube.com/embed/"); thishtml = thishtml.replace(ytclose, "\" frameborder=\"0\" allowfullscreen></iframe>"); thishtml = thishtml.replace(sopen, "<object width='483' height='387' type='application/x-shockwave-flash' data='http://scratch.mit.edu/static/misc/PlayerOnly.swf'><param name='allowScriptAccess' value='sameDomain'><param name='allowFullScreen' value='true'><param name='flashvars' value='project=http://scratch.mit.edu/static/projects/"); thishtml = thishtml.replace(sclose, ".sb?version=1'></object>"); thishtml = thishtml.replace(nothere, "antidoteexists=true&version=10"); thishtml = thishtml.replace(forumlink, "http://scratch.mit.edu/forums/viewtopic.php?id=93227"); // apply your changes to the page document.body.innerHTML = thishtml;
EDIT: added helpful comments.
Last edited by GeonoTRON2000 (2012-04-11 23:26:39)
Offline
roijac wrote:
[likecount]' onload='while(true){alert("stop making those stupid vulnerable scripts! disable it now!")}[/likecount]
Ok... new version. That no longer works. I didn't realize people were going to try to hack it *sigh*, but whatever. Hackers gonna hack.
Offline
scimonster wrote:
jvvg wrote:
I've always been wondering: how do you make a .js file into a browser extension? I only know how to make a Chrome .crx file.
Is there a tutorial or something?It's called a userscript. You end it with .user.js.
Code:
// ==UserScript== // @name Script name // @namespace Not sure... // @description Short description // @include http://google.com/ (only on google.com homepage) // @include http://*.google.com/ (only on anything.google.com homepage) // @include http://*.google.com/* (anything on anything.google.com) // @include http://*.google.tld/* (anything on anything.google.anything) // @exclude http://mail.google.tld/* (don't run on GMail) // ==/UserScript== // Regular old JavaScript code goes here.
Thanks, I will use that in the future.
Offline
roijac wrote:
[likebtn]' onmousedown='while(true){alert("stop making those stupid vulnerable scripts! disable it now!")}[/likebtn]
new version
Right back at 'ya! Lol... nothing javascript will work now... muahahahaha...
Well... if you manage to embed a <script> tag, that might work, but otherwise... muahahahaha....
Offline
GeonoTRON2000 wrote:
roijac wrote:
<a href='http://like.cfagency.org/like.php?site=' onmousedown='while(true){alert("stop making those stupid vulnerable scripts! disable it now!")}'><img src='http://like.cfagency.org/like.png' width='64' height='64' /></a>
new versionRight back at 'ya! Lol... nothing javascript will work now... muahahahaha...
Well... if you manage to embed a <script> tag, that might work, but otherwise... muahahahaha....
muahahahaha....
have no idea what's happening, but this works at least on my firefox
Last edited by roijac (2012-04-14 15:30:56)
Offline
Well... I have no idea how to help firefox people, but chrome works fine.
Sorry, I get them (firefox and safari) confused because I never use them.
Last edited by GeonoTRON2000 (2012-04-14 16:27:35)
Offline
roijac wrote:
got it, you should use document.getElementsByName() instead of the not cross-supported document.all
Thanks for the tip. It works with firefox now!
Offline
bump
Offline
roijac wrote:
GeonoTRON2000 wrote:
roijac wrote:
got it, you should use document.getElementsByName() instead of the not cross-supported document.all
Thanks for the tip. It works with firefox now!
oh wait this still doesn't work :
???
Maybe you need to reinstall. It works fine in my firefox.
EDIT: Oh, you mean the getElementsByName(). I know that doesn't work. What does is this:
var elements;
elements = document.all;
if (!elements) {
elements = document.getElementsByTagName("*");
}Last edited by GeonoTRON2000 (2012-04-15 16:23:15)
Offline
How do you put it in a sig?

Offline
*coughcough* necropost *coughcough*
Anyways, use:
[url=http://like.cfagency.org/like.php?site=referer][img ]http://like.cfagency.org/like.png[/img ][/url] - [img ]http://like.cfagency.org/counter.php?site=referer[/img ] likes.
Image tags spaced out, so fix those.
Offline
GeonoTRON2000 wrote:
*coughcough* necropost *coughcough*
Anyways, use:Code:
[url=http://like.cfagency.org/like.php?site=referer][img ]http://like.cfagency.org/like.png[/img ][/url] - [img ]http://like.cfagency.org/counter.php?site=referer[/img ] likes.Image tags spaced out, so fix those.
2 months is not a necropost. Should I get you some cold medicine for that cough of yours?

Offline
funelephant wrote:
GeonoTRON2000 wrote:
*coughcough* necropost *coughcough*
Anyways, use:Code:
[url=http://like.cfagency.org/like.php?site=referer][img ]http://like.cfagency.org/like.png[/img ][/url] - [img ]http://like.cfagency.org/counter.php?site=referer[/img ] likes.Image tags spaced out, so fix those.
2 months is not a necropost. Should I get you some cold medicine for that cough of yours?
2 months can be considered a necropost if the topic is irrelevant or the project has been cancelled or dropped
Offline
sparks wrote:
Yeah, necroposts are irrelevant posts that don't further the discussion. You should be glad people are still discussing your plugin.
![]()
No, but you see, that wasn't relevant to my plugin, it was relevant to my signature.
My plugin got old about a month ago.
@funelephant: *coughcoughcough* yes, I would like some cold medicine, thank you very much.
Last edited by GeonoTRON2000 (2012-06-19 11:04:43)
Offline