// ==UserScript==
// @name           jaro
// @namespace      http://d.hatena.ne.jp/edvakf/
// @include        http://www.google.co.jp/search*
// @license        MIT license (http://www.opensource.org/licenses/mit-license.php)
// ==/UserScript==
// original script : https://gist.github.com/149474/35164ef7a57b2505097ca19e2af81d20f7ad00a6
// $X function from : http://gist.github.com/3242
// modified by : edvakf
 
(function(fun) {
 
  if (!window.opera) fun();
  else window.addEventListener('DOMContentLoaded', fun, false);

  window.addEventListener('GM_AutoPagerizeNextPageLoaded', fun, false);
 
})(function() {
 
function $X(exp, context) {
  context || (context = document);
  var expr = (context.ownerDocument || context).createExpression(exp,
  function(prefix) {
    return document.createNSResolver(context.documentElement || context).lookupNamespaceURI(prefix) || context.namespaceURI || document.documentElement.namespaceURI || "";
  });
 
  var result = expr.evaluate(context, XPathResult.ANY_TYPE, null);
  switch (result.resultType) {
  case XPathResult.STRING_TYPE:
    return result.stringValue;
  case XPathResult.NUMBER_TYPE:
    return result.numberValue;
  case XPathResult.BOOLEAN_TYPE:
    return result.booleanValue;
  case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:
    // not ensure the order.
    var ret = [], i = null;
    while (i = result.iterateNext()) ret.push(i);
    return ret;
  }
  return null;
}
 
var sites = [
  /^https?:\/\/\w+\.designlinkdatabase\.net/, 
  /^https?:\/\/\w+\.thumbnailcloud\.net/, 
  /^https?:\/\/w+\.rightclicksright\.net/, 
  /^https?:\/\/w+\.designiddatabase\.net/, 
  /^https?:\/\/w+\.basefeed\.net/, 
  /^https?:\/\/buzzurl\.jp/, 
  /^https?:\/\/b\.hatena\.ne\.jp\/entry/,
  /^https?:\/\/clip\.livedoor\.com\/page/,
  /^https?:\/\/\w+\.pg-feed\.com/,
  /^https?:\/\/clip\.nifty\.com/,
  /^https?:\/\/bookmark\.fc2\.com/,
  /^https?:\/\/bookmarks.yahoo.co.jp/,
  /^https?:\/\/www\.blogpet\.net\/bookmark/,
  /^https?:\/\/swik\.net/
];
 
$X('/html/body/div[4]/div/ol/li[not(contains(@style,"opacity: 0.3"))]/h3/a').forEach(function(ele) {
  sites.forEach(function(site) {
    if (ele.href.match(site)) ele.parentNode.parentNode.style.opacity = '0.3'
  });
});
 
});

