Click here to Skip to main content
15,887,676 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Code I don't understand. Pin
Anlige2-Sep-14 21:01
Anlige2-Sep-14 21:01 
AnswerRe: Code I don't understand. Pin
Suresh Amudalapalli12-Sep-14 7:49
professionalSuresh Amudalapalli12-Sep-14 7:49 
Questionajax/php issue Pin
RalfPeter28-Aug-14 6:38
RalfPeter28-Aug-14 6:38 
AnswerRe: ajax/php issue Pin
Dennis E White28-Aug-14 8:45
professionalDennis E White28-Aug-14 8:45 
GeneralRe: ajax/php issue Pin
RalfPeter28-Aug-14 8:58
RalfPeter28-Aug-14 8:58 
SuggestionRe: ajax/php issue Pin
Dennis E White28-Aug-14 10:10
professionalDennis E White28-Aug-14 10:10 
Questionweb-based 3D mapping system using nVidia 3D vision Pin
Member 1101681125-Aug-14 6:33
Member 1101681125-Aug-14 6:33 
Questionmodifying Google Search to make results intentionally inaccurate Pin
Member 1103422325-Aug-14 2:11
Member 1103422325-Aug-14 2:11 
I already made a post at Superuser http://superuser.com/questions/800325/how-to-make-google-search-look-dumb[^]

I will summerize here:

[1] http://i.stack.imgur.com/ZN60B.jpg

My point is i do not want to see torrent sites in the search results,so if someone searches Google or any other search engine this phrase(-torrent-download-watch) should be automatically and invisibly added.

[2] http://i.stack.imgur.com/4mUSt.jpg

And one of the answers was this userscript written by krowe:

C#
// ==UserScript==
// @name       Tamper with Google Results
// @namespace  http://superuser.com/users/145045/krowe
// @version    0.1
// @description  This just modifies google results to exclude certain things.
// @match      http://*.google.com
// @match      https://*.google.com
// @copyright  2014+, KRowe
// ==/UserScript==


function GM_main () {
    window.onload = function () {
      var targ = window.location;
      if(targ && targ.href && targ.href.match('https?:\/\/www.google.com/.+#q=.+') && targ.href.search("/+-torrent/+-watch/+-download")==-1) {
        targ.href = targ.href +"+-torrent+-watch+-download";
      }
    };
}

//-- This is a standard-ish utility function:
function addJS_Node(text, s_URL, funcToRun, runOnLoad) {
    var D=document, scriptNode = D.createElement('script');
    if(runOnLoad) scriptNode.addEventListener("load", runOnLoad, false);
    scriptNode.type = "text/javascript";
    if(text) scriptNode.textContent = text;
    if(s_URL) scriptNode.src = s_URL;
    if(funcToRun) scriptNode.textContent = '(' + funcToRun.toString() + ')()';
    var targ = D.getElementsByTagName('head')[0] || D.body || D.documentElement;
    targ.appendChild(scriptNode);
}

addJS_Node (null, null, GM_main);



But the script is not working at all. I copied it to tampermonkey , tried it several times no luck.I need some help please.

I will be happy if this script can atleast work in YouTube,Bing and Yahoo.

Thank you in advance.
AnswerRe: modifying Google Search to make results intentionally inaccurate Pin
Anurag Gandhi25-Aug-14 23:02
professionalAnurag Gandhi25-Aug-14 23:02 
GeneralRe: modifying Google Search to make results intentionally inaccurate Pin
Member 1103422326-Aug-14 0:14
Member 1103422326-Aug-14 0:14 
GeneralRe: modifying Google Search to make results intentionally inaccurate Pin
Anurag.ag31-Aug-14 11:51
Anurag.ag31-Aug-14 11:51 
QuestionInsert Image in to MySql database Pin
Member 1045703324-Aug-14 23:06
professionalMember 1045703324-Aug-14 23:06 
SuggestionRe: Insert Image in to MySql database Pin
ZurdoDev25-Aug-14 3:18
professionalZurdoDev25-Aug-14 3:18 
AnswerRe: Insert Image in to MySql database Pin
Dennis E White25-Aug-14 4:05
professionalDennis E White25-Aug-14 4:05 
SuggestionRe: Insert Image in to MySql database Pin
Siben Nayak29-Aug-14 5:49
professionalSiben Nayak29-Aug-14 5:49 
GeneralRe: Insert Image in to MySql database Pin
Sunasara Imdadhusen3-Sep-14 21:10
professionalSunasara Imdadhusen3-Sep-14 21:10 
QuestioncreateElement, custom style, turn off webkit Appearance Pin
jkirkerx24-Aug-14 10:13
professionaljkirkerx24-Aug-14 10:13 
GeneralRe: createElement, custom style, turn off webkit Appearance Pin
Sunasara Imdadhusen3-Sep-14 21:11
professionalSunasara Imdadhusen3-Sep-14 21:11 
GeneralRe: createElement, custom style, turn off webkit Appearance Pin
jkirkerx4-Sep-14 6:13
professionaljkirkerx4-Sep-14 6:13 
AnswerRe: createElement, custom style, turn off webkit Appearance Pin
Sunasara Imdadhusen3-Sep-14 21:13
professionalSunasara Imdadhusen3-Sep-14 21:13 
QuestionPassword Validation Pin
jclito21-Aug-14 10:45
jclito21-Aug-14 10:45 
AnswerRe: Password Validation Pin
Richard Deeming22-Aug-14 2:40
mveRichard Deeming22-Aug-14 2:40 
AnswerRe: Password Validation Pin
ZurdoDev22-Aug-14 9:15
professionalZurdoDev22-Aug-14 9:15 
QuestionAccess Device API using Javascript Pin
Gouranga Das21-Aug-14 8:00
Gouranga Das21-Aug-14 8:00 
AnswerRe: Access Device API using Javascript Pin
Richard MacCutchan21-Aug-14 21:59
mveRichard MacCutchan21-Aug-14 21:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.