Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // --------------------------[ CastlevilleBonuses.201204132000.js ]-----
- //
- // ,-. . . . .
- // / | | o | |
- // | ,-: ,-. |- | ,-. . , . | | ,-.
- // \ | | `-. | | |-' |/ | | | |-'
- // `-' `-` `-' `-' | `-' ' ' ' ' `-'
- // |-. ,-. ,-. . . ,-. ,-. ,-.
- // | | | | | | | | `-. |-' `-.
- // `-' `-' ' ' `-` `-' `-' `-'
- //
- // --------------------------------------------------------[ Info ]-----
- //
- // Hello!
- //
- // This bookmarklet searches the links in the current page that start
- // with 'http://apps.facebook.com/playcastleville/receive.php?'. If some
- // are found, and depending of what the user chooses, it opens every url
- // sequentially in a new window (every 20 seconds) to get the bonuses,
- // or - if cancel is pressed - produces a list of all the bonuses found
- // (this might be useful for copy/pasting or saving the urls for
- // friends).
- //
- // I tested this on Chromium and Firefox. I don't know if it works for
- // other browsers, feel free to modify and redistribute this.
- //
- // How to use?
- // Simply create a new bookmark, possibly in your address bar, give it
- // any name you like, and for the address field, copy/paste one of the
- // "javascript:" line below. (Triple click to select the whole line)
- //
- // Attention: Don't close the windows while it's running, else you will
- // have to restart and fatally you will request the same bonuses.
- //
- // It is NOT advised to play while collecting bonuses. It works, sadly
- // your connection to the game may be reset while you play. But you can
- // harvest several pages of bonuses at the same time...
- //
- // Included are two other versions with prompts for the delay and the
- // search string. The three are nearly identical, basically, set d(elay)
- // and/or s(earch) to 0 near column 282. I also leave the unminified
- // script if you want to play with it.
- //
- // I also added a bookmarklet for The Sims Social and CityVille, for
- // other games, just change the s(earch) string at columns 225.
- //
- // As usual, if this thing destroy your computer, your town, or the
- // entire fabric of space-time, it's your business. Don't play with
- // something you don't understand, use with extreme caution and at your
- // own risks.
- //
- // Have Fun!
- // Yunga Palatino.
- //
- //
- // ------------------------------------------------[ Bookmarklets ]-----
- // CastleVille: http://apps.facebook.com/playcastleville/receive.php?
- javascript:(function(){function g(){if(i--){m.innerHTML="<br /><br /><br />"+i+" bonus pages to get...";w.location=b[i];setTimeout(g,d*1e3)}else{document.body.removeChild(m);alert("That's all folks!")}}var l,b,d,s,c,i,m,w;c='http://apps.facebook.com/playcastleville/receive.php?';d=20;s=c;s=s?c:prompt("What's the BEGINNING of the url?",c);if(!s)return;b=[];l=document.links;i=l.length;while(i--){if(!l[i].href.indexOf(s))b.push(l[i].href)}c=i=b.length;if(i>0){if(confirm('Get the '+i+' bonus(es) found?')){d=d?d:prompt('Delay in second between each bonus?',20);if(!d)return;m=document.createElement('div');m.setAttribute('style','position: fixed; top: 0px; left: 0px; bottom: 0px; right: 0px; background: #369; color: #fff; cursor: wait; text-align: center; vertical-align: middle; opacity: 0.9; z-index: 10000;');document.body.appendChild(m);w=window.open('about:blank');g()}else{w=window.open().document;w.writeln('<html><head><title>CastleVilleBonuses '+new Date().getTime()+'</title></head><body><h3>Bonus(es) from <a href="'+location.href+'">'+document.title+'</a>:</h3><hr />');while(i--){w.writeln('\n<a href="'+b[i]+'">'+b[i]+'</a><br />')}w.writeln('</body></html>')}}else{alert('No Bonus Found!')}})()
- // CastleVille + Delay:
- javascript:(function(){function g(){if(i--){m.innerHTML="<br /><br /><br />"+i+" bonus pages to get...";w.location=b[i];setTimeout(g,d*1e3)}else{document.body.removeChild(m);alert("That's all folks!")}}var l,b,d,s,c,i,m,w;c='http://apps.facebook.com/playcastleville/receive.php?';d=0;s=c;s=s?c:prompt("What's the BEGINNING of the url?",c);if(!s)return;b=[];l=document.links;i=l.length;while(i--){if(!l[i].href.indexOf(s))b.push(l[i].href)}c=i=b.length;if(i>0){if(confirm('Get the '+i+' bonus(es) found?')){d=d?d:prompt('Delay in second between each bonus?',20);if(!d)return;m=document.createElement('div');m.setAttribute('style','position: fixed; top: 0px; left: 0px; bottom: 0px; right: 0px; background: #369; color: #fff; cursor: wait; text-align: center; vertical-align: middle; opacity: 0.9; z-index: 10000;');document.body.appendChild(m);w=window.open('about:blank');g()}else{w=window.open().document;w.writeln('<html><head><title>CastleVilleBonuses '+new Date().getTime()+'</title></head><body><h3>Bonus(es) from <a href="'+location.href+'">'+document.title+'</a>:</h3><hr />');while(i--){w.writeln('\n<a href="'+b[i]+'">'+b[i]+'</a><br />')}w.writeln('</body></html>')}}else{alert('No Bonus Found!')}})()
- // SearchString + Delay:
- javascript:(function(){function g(){if(i--){m.innerHTML="<br /><br /><br />"+i+" bonus pages to get...";w.location=b[i];setTimeout(g,d*1e3)}else{document.body.removeChild(m);alert("That's all folks!")}}var l,b,d,s,c,i,m,w;c='http://apps.facebook.com/playcastleville/receive.php?';d=0;s=0;s=s?c:prompt("What's the BEGINNING of the url?",c);if(!s)return;b=[];l=document.links;i=l.length;while(i--){if(!l[i].href.indexOf(s))b.push(l[i].href)}c=i=b.length;if(i>0){if(confirm('Get the '+i+' bonus(es) found?')){d=d?d:prompt('Delay in second between each bonus?',20);if(!d)return;m=document.createElement('div');m.setAttribute('style','position: fixed; top: 0px; left: 0px; bottom: 0px; right: 0px; background: #369; color: #fff; cursor: wait; text-align: center; vertical-align: middle; opacity: 0.9; z-index: 10000;');document.body.appendChild(m);w=window.open('about:blank');g()}else{w=window.open().document;w.writeln('<html><head><title>CastleVilleBonuses '+new Date().getTime()+'</title></head><body><h3>Bonus(es) from <a href="'+location.href+'">'+document.title+'</a>:</h3><hr />');while(i--){w.writeln('\n<a href="'+b[i]+'">'+b[i]+'</a><br />')}w.writeln('</body></html>')}}else{alert('No Bonus Found!')}})()
- // CityVille: https://apps.facebook.com/cityville/Reward.php?
- javascript:(function(){function g(){if(i--){m.innerHTML="<br /><br /><br />"+i+" bonus pages to get...";w.location=b[i];setTimeout(g,d*1e3)}else{document.body.removeChild(m);alert("That's all folks!")}}var l,b,d,s,c,i,m,w;c='https://apps.facebook.com/cityville/Reward.php?';d=20;s=c;s=s?c:prompt("What's the BEGINNING of the url?",c);if(!s)return;b=[];l=document.links;i=l.length;while(i--){if(!l[i].href.indexOf(s))b.push(l[i].href)}c=i=b.length;if(i>0){if(confirm('Get the '+i+' bonus(es) found?')){d=d?d:prompt('Delay in second between each bonus?',20);if(!d)return;m=document.createElement('div');m.setAttribute('style','position: fixed; top: 0px; left: 0px; bottom: 0px; right: 0px; background: #369; color: #fff; cursor: wait; text-align: center; vertical-align: middle; opacity: 0.9; z-index: 10000;');document.body.appendChild(m);w=window.open('about:blank');g()}else{w=window.open().document;w.writeln('<html><head><title>CastleVilleBonuses '+new Date().getTime()+'</title></head><body><h3>Bonus(es) from <a href="'+location.href+'">'+document.title+'</a>:</h3><hr />');while(i--){w.writeln('\n<a href="'+b[i]+'">'+b[i]+'</a><br />')}w.writeln('</body></html>')}}else{alert('No Bonus Found!')}})()
- // The Sims Social: https://apps.facebook.com/thesimssocial/feed?
- javascript:(function(){function g(){if(i--){m.innerHTML="<br /><br /><br />"+i+" bonus pages to get...";w.location=b[i];setTimeout(g,d*1e3)}else{document.body.removeChild(m);alert("That's all folks!")}}var l,b,d,s,c,i,m,w;c='https://apps.facebook.com/thesimssocial/feed?';d=20;s=c;s=s?c:prompt("What's the BEGINNING of the url?",c);if(!s)return;b=[];l=document.links;i=l.length;while(i--){if(!l[i].href.indexOf(s))b.push(l[i].href)}c=i=b.length;if(i>0){if(confirm('Get the '+i+' bonus(es) found?')){d=d?d:prompt('Delay in second between each bonus?',20);if(!d)return;m=document.createElement('div');m.setAttribute('style','position: fixed; top: 0px; left: 0px; bottom: 0px; right: 0px; background: #369; color: #fff; cursor: wait; text-align: center; vertical-align: middle; opacity: 0.9; z-index: 10000;');document.body.appendChild(m);w=window.open('about:blank');g()}else{w=window.open().document;w.writeln('<html><head><title>CastleVilleBonuses '+new Date().getTime()+'</title></head><body><h3>Bonus(es) from <a href="'+location.href+'">'+document.title+'</a>:</h3><hr />');while(i--){w.writeln('\n<a href="'+b[i]+'">'+b[i]+'</a><br />')}w.writeln('</body></html>')}}else{alert('No Bonus Found!')}})()
- // --------------------------------------------------[ JavaScript ]-----
- javascript:(function () {
- function g() { // get the bonuses
- if (i--) {
- m.innerHTML = "<br /><br /><br />" + i + " bonus pages to get...";
- w.location = b[i];
- setTimeout(g, d * 1000)
- } else {
- document.body.removeChild(m);
- alert("That's all folks!");
- }
- }
- var l, b, d, s, c, i, m, w; // links, bonuses, delay, search, castleville string/counter, iterations, message element, window
- c = 'http://apps.facebook.com/playcastleville/receive.php?';
- d = 20; // d = 0; // set to 0 if you want to be prompted for delay
- s = c; // s = 0; // set to 0 if you want to be prompted for another search string
- s = s ? c : prompt("What's the BEGINNING of the url?", c);
- if (!s) return;
- b = [];
- l = document.links;
- i = l.length;
- while (i--) {
- if (!l[i].href.indexOf(s)) b.push(l[i].href)
- }
- c = i = b.length;
- if (i > 0) {
- if (confirm('Get the ' + i + ' bonus(es) found?')) { // Get the bonuses
- d = d ? d : prompt('Delay in second between each bonus?', 20);
- if (!d) return;
- m = document.createElement('div');
- m.setAttribute('style', 'position: fixed; top: 0px; left: 0px; bottom: 0px; right: 0px; background: #369; color: #fff; cursor: wait; text-align: center; vertical-align: middle; opacity: 0.9; z-index: 10000;');
- document.body.appendChild(m);
- w = window.open('about:blank');
- g()
- } else { // List found bonuses
- w = window.open().document;
- w.writeln('<html><head><title>CastleVilleBonuses '+new Date().getTime()+'</title></head><body><h3>Bonus(es) from <a href="' + location.href + '">' + document.title + '</a>:</h3><hr />');
- while (i--) {
- w.writeln('\n<a href="'+ b[i] +'">'+ b[i] +'</a><br />')
- }
- w.writeln('</body></html>')
- }
- } else {
- alert('No Bonus Found!')
- }
- })()
- // -----------------------------------------------------[ The End ]-----
- // QlpoOTFBWSZTWe7KfUUAAaxYAGAAQABgADABUaKhmgEnqkgKmpRvr5Y022RJu7oD3XvXH
- // de93bodXad3l6cvXsL3aD0wvXWN113j3c70tVzSZjCINYJlFIFmz5NS7crNRQwkRACRNm
- // jWFAGxptJVSiBzk6XDobilu6XTuyZjQkxUkb9sscLYstbRutnW6yMat0GjSiyy7aktNLt
- // 2OxFQrCzdm4axHhdyRThQkO7KfUU=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement