My Opera is closing 1st of March

Croquemichette

Un blog qui veut dire tellement de choses...

WOT for Opera


Update : More details about the new version smile

This is my first post in this blog after about 2 years of subscription. Better late than never, right ?

I guess I won't say/write a lof of things in this blog, but I'll at least share some useful (I hope so...) User Javascript for Opera.

In this first post, I will share with you my first UserJS : WOT for Opera.

For those who don't know what's WOT (Web Of Trust), take a look at this website.
To summarize, WOT, using its members' contribution, gives a score of a website. In fact, it gives 4 scores :
- Trustworthiness : Can you trust this website ?
- Vendor reliability : Do you think you can buy on this website ?
- Privacy : Are you sure you can search porn on this website without being tracked ?
- Child Safety : Can kids go on this website ?

These scores go from 0 to 100. 0 suxx, 100 roxx bigsmile
To simplify, you have 5 icons, from green to red :
- Green : 80-100
- Light green : 60-79,99
- Yellow : 40-59,99
- Orange : 20-39,99
- Red : 0-19,99


Let's now talk about this UserJS. It's made to work on various search engines. It will display the icon of the average score of the website ((sum of 4 previous scores)/4), at the left of the link in the search engine :



Hold over the mouse on the icon (you can change the size of the icons by modifying values of ImgWidth and ImgHeight), and you'll see details of the website :


If it's red, click at your own risk ninja

It supports 24 search engines :
- Google
- Yahoo
- Exalead
- Ask
- Netscape
- AllTheWeb
- Altavista
- Bing
- Yebol
- Duck Duck Go
- Seek.fr
- Yauba
- Baidu
- Green Maven
- Ethicle
- Good Tree
- Ecocho
- Yandex
- Orange
- Le moteur
- Voila
- Clusty
- Dogpile
- Metacrawler

Any search engine can work with this UserJS. You just need to develop a parser smile

It will also display the score of the current website at the top right of the page. You can disable this by setting b_checkCurrentSite as false.

Supported languages are : English, French, Spanish, Italian, Deutsch, Turkish.

There's also an updater (since v0.9). It will check every 7 days (cookies must be enabled) if a new version is available.

If you want to try this UserJS, just download it.
If you want to add new translations or search engines in this UserJS, just say so, I'll see what I can do.
If you think it sucks, just say so. If you think it rocks, just say so.

See you for the next UserJS.

Where is it ?

Comments

Evangelline Friday, November 13, 2009 10:48:33 PM

Yeah, that rocks !

João EirasxErath Saturday, November 14, 2009 4:23:29 AM

Looks good, but please wrap the script with an anonymous function, else everything leaks into the global scope.

dapxin Saturday, November 14, 2009 9:13:15 AM

interesting stuff...

PHcphr666 Saturday, November 14, 2009 11:01:59 AM

Originally posted by xErath:

Looks good, but please wrap the script with an anonymous function, else everything leaks into the global scope.


That's what I wanted to do, but because of a callback function (Json), I can't. If you have an idea, let me know smile

blinkybill Saturday, November 14, 2009 12:53:06 PM

Hi,

I really like your wot js file but one thing
I noticed if you click on the coloured icon
beside the search result it takes you a wot
page in french.
Can it be made to go to the english site of wot?

cheers
blinky

João EirasxErath Saturday, November 14, 2009 6:58:52 PM

Originally posted by PH`:

That's what I wanted to do, but because of a callback function (Json), I can't. If you have an idea, let me know


Wrap everything in an anonymous function, and export your function doing
window.m_func = blah;
function blah(){
  delete window.m_func;
  /*rest of code*/
}

Also, you can use DOMContentLoaded instead of the load event, so your script will trigger when the dom is ready, but inlines are still loading.
Next, you can get the domain of a link by checking link.hostname. Opera 10 has a bug and reports the port on that property, but you can strip it using
link.host.replace(/:\d+$/,'');


PHcphr666 Sunday, November 15, 2009 12:51:34 AM

Thanks xErath. I added an anonymous function, everything's OK. I didn't know that tip. In fact, by looking at your blog, I don't know a lot bigsmile

I also set the listener to DOMContentLoaded, it makes the WOT icons show earlier, so let's say faster smile

dapxin Sunday, November 15, 2009 3:38:09 AM

Can you try to leave a message here each time you update this ? :-)

dapxin Sunday, November 15, 2009 3:38:09 AM

Can you try to leave a message here each time you update this ? :-)

QuHno Sunday, November 15, 2009 6:56:15 PM

Very nice yes

Hope you've got the strings for the German translation ...

Mağruf ÇolakoğluZAHEK Sunday, November 15, 2009 9:02:58 PM

Really interesting.Thanks.

Mağruf ÇolakoğluZAHEK Sunday, November 15, 2009 9:14:02 PM

It is not working completeley witk yahoo.pls see link.
http://search.yahoo.com/search?p=zahek&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-832

QuHno Sunday, November 15, 2009 9:25:16 PM

fr.altavista.com/web/results?itag=ody&q=test&kgs=1&kls=0

and all other national altavistas too...

PHcphr666 Sunday, November 15, 2009 10:19:19 PM

QuHno, what's your problem with Altavista ?

I've uploaded a new version with :
- Correction for Yahoo (thanks ZAHEK)
- @include for all supported search engines
- A few modifications in the code

You can download it at : http://files.myopera.com/PH`/UserJs/wot.js

Mağruf ÇolakoğluZAHEK Monday, November 16, 2009 8:54:11 AM

This is the first official news about UserJS in Turkish smile
http://www.operaturkiye.net/opera-ve-wot-ile-daha-guvenli-bir-internet

QuHno Monday, November 16, 2009 1:19:58 PM

Originally posted by PH`:

QuHno, what's your problem with Altavista ?


Nearly the same as was with Yahoo - some links weren't tested, maybe the same problem as it was with Yahoo? I is basically the same search engine wink

But it seems, that only shown subpages in the results are not tested doh so no real problem (it was late yesterday wink)

PHcphr666 Monday, November 16, 2009 1:48:00 PM

It's normal, but I didn't mention it. In fact, this UJS only adds a WOT icon to the first link of a same domain. I should think about something in order to add icons to each link of a same domain.

PHcphr666 Tuesday, November 17, 2009 10:10:31 PM

I've just uploaded a new version, here is the changelog :
0.4 (2009-11-17):
+ New language: Italian
+ New language: Spanish
+ New search engine www.dogpile.com
+ New search engine www.metacrawler.com
* Yebol: id "searchw_result" doesn't exist anymore. Replaced by document.getElementsByTagName("body")[0]. Class "st" replaced by "stw".
* All links from a same domain have now a WOT icon

dudekracked Wednesday, November 18, 2009 2:28:11 AM

great script PH'!

PHcphr666 Wednesday, November 18, 2009 11:06:08 AM

New version is online :
0.5 (2009-11-18):
* WOT for Opera is now (almost fully) compatible with google-pager
* WOT icon at the top-right is now back if b_checkCurrentSite is true (only available in included domains)

BobJam Thursday, November 19, 2009 9:15:47 PM

I can't get it to work with Linux/Ubuntu. The Opera instructions for installing a user script ( http://my.opera.com/operafan2006/blog/2007/02/13/how-to-install-user-java-script-in-opera ) are for Windows. I saved the script as "Opera_WOT_Script. js" with gedit in my Ubuntu /home directory, but when I pointed to it, Opera wouldn't load it . . . I couldn't even get it to highlight.

Is there a separate set of instructions for Linux? If so, I can't find them.

LinkDefender0fHyrule Thursday, November 19, 2009 9:23:05 PM

Fantastic! If you make it possible to rate in Opera as well, you'll be my hero! =D

PHcphr666 Thursday, November 19, 2009 10:27:51 PM

Originally posted by BobJam:

I can't get it to work with Linux/Ubuntu.


I did it under Debian, so... bigsmile
Create a directory "userjs" into /home/<user>/.opera
Put the script into this directory.
Then, in Opera, go to Tools > Preferences > Advanced > Content > Javascript Options, and set UserJS textbox as /home/<user>/.opera/userjs and restart Opera \o/

Originally posted by Defender0fHyrule:

Fantastic! If you make it possible to rate in Opera as well, you'll be my hero! =D


I'll check this out.

BobJam Friday, November 20, 2009 6:18:48 PM

Originally posted by PH`:

I did it under Debian, so...
Create a directory "userjs" into /home/<user>/.opera
Put the script into this directory.
Then, in Opera, go to Tools > Preferences > Advanced > Content > Javascript Options, and set UserJS textbox as /home/<user>/.opera/userjs and restart Opera

I got it to work doing that. The reason I didn't before was that the Opera instructions say "select the folder", not type it in.

Thanks for the tip. Perhaps Opera could make a mention of the slightly different Linux method on the instruction page.

Originally posted by Defender0fHyrule:

If you make it possible to rate in Opera as well

If you are a registered WOT user, than this works: Go to the WOT site and log in, then when you go to the scorecard (by clicking on the WOT donut next to the link in the search), it will then show the "Edit my rating" link above the categories. You can click on that "Edit" link and then make your rating and then click on the "Save" button after you've made your ratings (by sliding the indicator in each category). The key to this is logging in.

Sort of a roundabout way to do it, but I haven't found the WOT icon in a toolbar to do it that way, as you would say in FF.

Originally posted by PH`:

WOT icon at the top-right is now back

Don't see it. Is it on a toolbar, or does it create it's own toolbar?

erikiscool Sunday, November 22, 2009 6:56:28 AM

I love it but it doesn't block bad sites

erikiscool Sunday, November 22, 2009 6:58:44 AM

and i dont see the icon on the top right

QuHno Sunday, November 22, 2009 11:04:18 AM

Originally posted by erikiscool:

I love it but it doesn't block bad sites

Why should it?
If a site has i.e. a poor vendor reliability, it does no harm to my computer - and not clicking on a link with a red circle before it blocks quite thoroughly, I think wink

erikiscool Sunday, November 22, 2009 7:54:26 PM

I just liked that feature on the firefox one

erikiscool Sunday, November 22, 2009 7:55:22 PM

and i tested on a freeweb i created and rated bad

PHcphr666 Monday, November 23, 2009 7:40:08 PM

Originally posted by Defender0fHyrule:

Fantastic! If you make it possible to rate in Opera as well, you'll be my hero! =D


I guess, for now, I won't do it.
First : there is nothing about that in the WOT wiki.
Second : I don't know if you're logged on WOT when you're on Google.

DaringineerQuadunit404 Tuesday, November 24, 2009 2:17:22 AM

Does not seem to be working in Opera 10.10 right now :|

QuHno Tuesday, November 24, 2009 5:31:30 AM

No problems here except from a short "downtime" (sluggish performance) of WOT itself yesterday, but the script worked fine.
Opera 10.10 b 1893 on XP, Vista and W7 ...

Suggestion: May be a "No WOT Response (timeout)" image as visible indicator would help? (if possible)

DaringineerQuadunit404 Tuesday, November 24, 2009 5:33:39 AM

I installed the UJS file using the UserJS Manager, so I don't know what's wrong :|

PHcphr666 Tuesday, November 24, 2009 9:49:07 AM

Originally posted by Quadunit404:

I installed the UJS file using the UserJS Manager, so I don't know what's wrong :|


I've just tried it. I have to copy/paste the content of the UserJS in UJS Manager, save it as wot.js to make it work.
Wasn't there a pop-up when document.location has ".js" in it to save it ?

DaringineerQuadunit404 Tuesday, November 24, 2009 4:57:57 PM

Just tried that. Still did not work.

PHcphr666 Tuesday, November 24, 2009 5:50:02 PM

That's what I did today, and it worked perfecly (Opera 10.10 final).
Check in your UserJS folder if this one has an extension ".js", or if exists.

DaringineerQuadunit404 Tuesday, November 24, 2009 6:42:11 PM



That's what my UserJS folder looks like. When taking that screenshot wot.js had just happened to been highlighted p

PHcphr666 Wednesday, November 25, 2009 8:55:45 AM

Where did you try this UJS ? On one of the search engines listed in the original post ?

DaringineerQuadunit404 Wednesday, November 25, 2009 6:54:09 PM

Yes, on Google. There wasn't any WOT logo next to the search results.

PHcphr666 Wednesday, November 25, 2009 9:13:57 PM

Try to disable other UJS used on Google, and see if there is any difference. Maybe some are not compatible with WOT UJS.

DaringineerQuadunit404 Wednesday, November 25, 2009 11:06:36 PM

Disabled my two other Google UJS, still nothing.

I'll try removing them and then disabling my YouTube scripts to see if that works.

UPDATE: Nope, disabling the YouTube scripts didn't work. Looks like I'll have to wait until I get a chance to finish setting up this WinXP VM and installing this UserJS in there to see if it makes a difference on whether I'm using the UJS Manager or not.

PHcphr666 Thursday, November 26, 2009 9:00:29 PM

Weird... What about Yahoo ? Bing ? Ask ? Etc...

Check in the Error Console (Tools > Advanced > Error Console), maybe there's an error regarding my UJS.

DaringineerQuadunit404 Friday, November 27, 2009 1:21:21 AM

Aha, here's the problem, line 983 isn't reading right!

What the error console says:
Syntax error C:\Users\Tom\Documents\UserJS\wot.js: line 983 of User JS script :
Expected token: '}'
window.wot_showHide = wot_showHide;
-------------------------------------^

PHcphr666 Tuesday, December 1, 2009 9:11:23 PM

Can you upload somewhere this UJS (the one you have on your computer) so that I can find why you have this error (because I don't have it...) ?

Thanks.

DaringineerQuadunit404 Tuesday, December 1, 2009 9:56:53 PM

I'll upload it to My files and let you check for the error. But first, I've a new version of VirtualBox to install (3.1.0). I'll be sure to upload wot.js after that's done installing.

UPDATE: http://files.myopera.com/Quadunit404/files/wot.js

PHcphr666 Wednesday, December 2, 2009 7:33:10 AM

OK, I got it. the last line is missing. But the online version has this last line.

You can just add this line at the end (after window.wot_showHide....) :
})(window.opera);

Luis RicardoLuRCon Wednesday, December 2, 2009 8:14:27 AM

I dont see the icon on the top right

QuHno Wednesday, December 2, 2009 9:45:14 AM

It shows only on the included sites, not on every site, meaning: the search engine result pages and only, if you change the line
var b_checkCurrentSite = false;

to
var b_checkCurrentSite = true;

If you wat it to see it on other pages, you must edit the @include lines, too.

But you could use the WOT Button for checking every page you want manually...
opera:/button/Go%20to%20page,%22javascript%3A(function()%7Bvar%20f%3Ddocument.getElementById('wot-bookmarklet')%3Bif(f)%7Bf.parentNode.removeChild(f)%3Breturn%3B%7Dvar%20l%3Dlocation.hostname%3Bif(l%20%26%26%20l.length)%7Bf%3Ddocument.createElement('iframe')%3Bif(f)%7Bf.setAttribute('id'%2C'wot-bookmarklet')%3Bf.setAttribute('src'%2C'http%3A%2F%2Fwww.mywot.com%2Fbookmarklet%2F'%2BencodeURIComponent(location.hostname))%3Bf.setAttribute('frameborder'%2C0)%3Bf.setAttribute('scrolling'%2C'no')%3Bf.setAttribute('style'%2C'position%3Afixed%3Btop%3A10px%3Bleft%3A10px%3B'%2B'width%3A135px%3Bheight%3A235px%3Bborder%3A0%3Bmargin%3A0%3Bpadding%3A0%3Bz-index%3A10487575%3B')%3Bvar%20div%3Ddocument.createElement('div')%3Bdiv.setAttribute('id'%2C'wot-opera')%3Bdiv.setAttribute('style'%2C%20'position%3Afixed%3Btop%3A10px%3Bleft%3A10px%3B'%2B'width%3A135px%3Bheight%3A235px%3Bborder%3A0%3Bmargin%3A0%3Bpadding%3A0%3Bz-index%3A10487576%3Bopacity%3A0%3B')%3Bdiv.onclick%20%3D%20function()%7Bvar%20f%3Ddocument.getElementById('wot-bookmarklet')%3Bif(f)%7Bf.parentNode.removeChild(f)%3B%7Dvar%20div%3D%20document.getElementById('wot-opera')%3Bif(div)%7Bdiv.parentNode.removeChild(div)%3B%7D%7D%3Bif(document.body)%7Bdocument.body.appendChild(f)%3Bdocument.body.appendChild(div)%3B%7D%7D%7D%7D)()%3B%22,1,%22WOT%22,%22Trust%20Information%22

Copy to address line, hit enter, drag the link of the error page to the toolbar you want...
It uses the Security Info graphic as button image.

DaringineerQuadunit404 Wednesday, December 2, 2009 11:03:34 PM

Yep, works just fine now! Thanks smile

Emil Albualbuemil Thursday, December 3, 2009 12:43:31 PM

Great idea and works well, but i have a little problem.
Any way to make it compatible with GoogleFX ?
If I use GoogleFX and have the numbers show up ("Show counter numbers") then the numbers are all wrong.
A solution would be to show the WOT icon after the text of the link (not in front of it like it is now), maybe add an option where to add the WOT icon.

Write a comment

New comments have been disabled for this post.