Advertisement
Guest User

Untitled

a guest
Jun 21st, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function ()
  2. {
  3.     var href = "";
  4.     switch (true)
  5.     {
  6.         case / 2ch - c\.net / .test(location.href):
  7.             href = $("table.tablesorter a#pickup").attr("href").extractUrl();
  8.             break;
  9.         case / 2ch\.logpo\.jp / .test(location.href):
  10.             location.href = $("div#headline h2 a").attr("href");
  11.             break;
  12.         case / 2ch - matome\.net / .test(location.href):
  13.             $("li.entry_title a").each(function (i)
  14.             {
  15.                 if ($(this).attr("style") == "color:red;") {
  16.                     href = $(this).attr("href");
  17.                     return false;
  18.                 }
  19.             });
  20.             break;
  21.         case / newser\.cc / .test(location.href):
  22.             $("td.news-link a").each(function (i)
  23.             {
  24.                 if ($(this).attr("style") == "background:#fff8dc; color:#F00;") {
  25.                     href = $(this).attr("href");
  26.                     return false;
  27.                 }
  28.             });
  29.             break;
  30.         case / matomeantena\.com\/feed/.test(location.href):
  31.         case / nullpoantenna\.com\/feed/.test(location.href):
  32.             href = $("div#rss_entry_list li.rss_link a").attr("href").extractUrl();
  33.             break;
  34.         case / news - choice\.net / .test(location.href):
  35.             href = $("div.pickuptitle a").attr("href");
  36.             break;
  37.         case / katuru\.com\/rss/.test(location.href):
  38.             href = $("h1.rss_center_div a").attr("href");
  39.             break;
  40.         case / 2ch\.shakin\.in / .test(location.href):
  41.             href = $("li.ID0 a").attr("href");
  42.             break;
  43.         case / matomeja\.jp\/feed/.test(location.href):
  44.             href = $("td.entry a.active").attr("href");
  45.             break;
  46.         case / anything - navi\.net / .test(location.href):
  47.             href = $("table#SortTable a strong").closest("a").attr("href");
  48.             break;
  49.         case / . + \.doorblog\.jp / .test(location.href):
  50.         case / . + \.livedoor\.jp / .test(location.href):
  51.             switch (true)
  52.             {
  53.                 case / matometatta / .test(location.href):
  54.                     href = $("div#main div.title a").attr("href");
  55.                     break
  56.             }
  57.             if (href.isValidUrl()) {
  58.                 break
  59.             }
  60.             if ($("a.title_link").length) {
  61.                 href = $("a.title_link").attr("href")
  62.             }
  63.             else if ($(".title_link a").length) {
  64.                 href = $(".title_link a").attr("href")
  65.             }
  66.             else if ($("div.select a").length) {
  67.                 href = $("div.select a").attr("href")
  68.             }
  69.             else if ($("div.selected a").length) {
  70.                 href = $("div.selected a").attr("href")
  71.             }
  72.             break;
  73.         case / . + \.fc2.com / .test(location.href):
  74.             if ($("div.selected a").length) {
  75.                 href = $("div.selected a").attr("href")
  76.             }
  77.             else if ($("div.pickup_title a").length) {
  78.                 href = $("div.pickup_title a").attr("href")
  79.             }
  80.             break
  81.     }
  82.     try {
  83.         ret = href.isValidUrl()
  84.     }
  85.     catch (e) {
  86.         ret = false
  87.     }
  88.     if (ret) {
  89.         location.href = "http://mato-me.net/detail/" + href;
  90.     }
  91. });
  92. String.prototype.extractUrl = function ()
  93. {
  94.     return this.match(/http:\/\/.+$/).toString();
  95. };
  96. String.prototype.isValidUrl = function ()
  97. {
  98.     if (/^http:\/\/.+$/.test(this)) {
  99.         return true
  100.     }
  101.     else {
  102.         return false;
  103.     }
  104. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement