Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () { // function wrapper for Opera
- var pics = document.evaluate(
- "//a[contains(@href, '.blogger.com/')]",
- document,
- null,
- XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
- null);
- var img, link, matchesLink, matchesImg,
- regexp = /^http:\/\/bp\d\.blogger\.com\/[^\/]+\/[^\/]+\/[^\/]+\/([^\/]+)\/([^\/]+)\/.+$/;
- for (var i = 0; i < pics.snapshotLength; i++) {
- link = pics.snapshotItem(i);
- matchesLink = link.href.match(regexp);
- if (matchesLink) {
- if (matchesLink[2].search(/-R/) > -1) {
- alert(link.firstChild.src);
- matchesImg = link.firstChild.src.match(regexp);
- if (matchesImg != null) {
- link.href = link.href.replace(new RegExp(matchesLink[1]),
- matchesImg[1]);
- link.href = link.href.replace(/\/s\d+-R\//, "/s1600-h/");
- }
- } else {
- if (matchesLink[0].search(/\/s\d+\//) > -1) {
- link.href = link.href.replace(/\/s\d+\//, "/s1600-h/");
- }
- }
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment