Source for "Photobucket Image Relinker"

  1. // PhotobucketImage Relinker user script
  2. // version 0.2
  3. // 2006-11-21
  4. // Copyright (c) 2006, thorbenhauer
  5. // Released under the GPL license
  6. // http://www.gnu.org/copyleft/gpl.html
  7. //
  8. // -----------------------------------------------------------------------------
  9. //
  10. // Based on Google Image Relinker user script by Patrick Cavit
  11. // Homepage: http://patcavit.com/
  12. // Script location: http://userscripts.org/scripts/show/792
  13. //
  14. // Copyright Notice by Patrick Cavit, pcavit@gmail.com:
  15. // Copy, use, modify, spread as you see fit. Massive thanks go out to
  16. // Eric Hamiter, this code is just a quick modification of his extension at
  17. // http://roachfiend.com/
  18. //
  19. // With MODifications by FurYy
  20. // http://userscripts.org/people/1618
  21. //
  22. // -----------------------------------------------------------------------------
  23. //
  24. // This program is free software; you can redistribute it and/or modify
  25. // it under the terms of the GNU General Public License as published by
  26. // the Free Software Foundation; either version 2 of the License, or
  27. // (at your option) any later version.
  28. //
  29. // This program is distributed in the hope that it will be useful,
  30. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  31. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  32. // GNU General Public License for more details.
  33. //
  34. // You should have received a copy of the GNU General Public License
  35. // along with this program; if not, write to the Free Software
  36. // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  37. //
  38. // -----------------------------------------------------------------------------
  39. //
  40. // ==UserScript==
  41. // @name Photobucket Image Relinker
  42. // @namespace BENKLING!!!
  43. // @description Rewrites Google Image Search links to point straight to the pictures.
  44. // @include http://s31.photobucket.com/albums/c369/benkling/
  45. // for Opera (which doesn't understand tld):
  46. // @include http://images.google.com/images?*
  47. // @include http://images.google.de/images?*
  48. // ==/UserScript==
  49. //
  50. // -----------------------------------------------------------------------------
  51. (function () { // function wrapper for Opera

  52. createLinks();
  53. window.addEventListener("resize", createLinks, true);

  54. function createLinks() {
  55. var googLinks = document.evaluate('//a[contains(@href, "/?action=view")]' +
  56. '[contains(@href, "&current=")]', document, null,
  57. XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  58. // MOD: links the domain name to the original google link
  59. var googFonts = document.evaluate('//font[contains(@color, "#000000")]',
  60. document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  61. var link, gmatch, font;
  62. for (var i = 0; i <>
  63. link = googLinks.snapshotItem(i);
  64. font = googFonts.snapshotItem(i);
  65. gmatch = link.href.match( /\/?action=view&current\=(.*?)\&imgrefurl\=/ );
  66. // MOD: links the domain name to the original google link
  67. font.innerHTML = "\"" + link.href + "\">" + font.innerHTML +
  68. "";
  69. link.href = decodeURI(gmatch[1]);
  70. }
  71. }

  72. })(); // function wrapper for Opera
Image hosting by PhotobucketImage hosting by PhotobucketImage hosting by PhotobucketImage hosting by PhotobucketImage hosting by PhotobucketImage hosting by PhotobucketImage hosting by PhotobucketImage hosting by PhotobucketImage hosting by PhotobucketImage hosting by Photobucket
Yayın yok.
Yayın yok.