-1

Please be kind, I'm new to Fiddler

My purpose:I want to use Fiddler as a Google search filter

Summary:

I'm tired of manually adding "dog" every time I use Google.I do not want the "dog" appearing in my search results.

For example:

//www.google.com/search?q=cat+-dog

//www.google.com/search?q=baseball+-dog

CODE:

dog replaced with -torrent-watch-download

// ==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);

At first I was going to go with Tampermonkey userscripts,Because I did not know about Fiddler

==================================================================================

Now,lets focus on Fiddler

Before Request:

I want Fiddler to add text at the end of Google Query string.

Someone suggested me to use

static function OnBeforeRequest(oSession: Session) {

    if (oSession.uriContains("targetString")) {
          var sText = "Enter a string to append to a URL";
          oSession.fullUrl = oSession.fullUrl + sText;
    }
}

Before Response:

This is where my problem lies

I totally love the HTML response,Now I just want to scrape/hide the word in the search box without changing the search results.How can it be done? Any Ideas?

https://i.stack.imgur.com/4mUSt.jpg

Can you guys please take the above information and fix the problem for me

Thank you

nasekt
  • 15
  • 7
  • Dupe of question asked here: http://www.telerik.com/forums/fiddler-programmatically-add-word-to-query-string – EricLaw Sep 04 '14 at 14:23

1 Answers1

0

Basing on goal definition above, I believe you can achieve better results with your own free Google custom search engine service. In particular, because you have control over GCSE fine-tuning results, returned by regular Google search.

Links:

https://www.google.com/cse/all

https://developers.google.com/custom-search/docs/structured_search

Voronenko
  • 56
  • 7
  • But with Fiddler's method you can apply to several other sites like Youtube or Bing;Modify javascripts,CSS,HTML and do many more.Anyway,I ran into a small problem http://imgur.com/shLr0WO ,It wont apply to google.co.uk,any help? Thanks – nasekt Sep 07 '14 at 10:14