Tutorials: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
Gabriel (talk | contribs)
Reverting to last version by LouCypher
Line 1: Line 1:
// ==UserScript==
Most of the information on this site is helpful. See the [[Greasemonkey Manual]] for starters.
// @name Ask.fm Auto Like by Gabriel Santos
// @namespace                  http://userscripts.org/scripts/show/999999
// @version 2.0
// @copyright         http://ask.fm/GabriielSantos1
// @description         Auto Like Ask.fm
// @author (http://userscripts.org/users/476758)
// @include http://ask.fm/*
// @icon http://s3.amazonaws.com/uso_ss/icon/138450/large.gif?1342345458
// Like Automatico Para Ask.FM
// Version numero 2
// DON'T COPY THIS SOURCE CODE!!! THIS CODE HAVE A COPYRIGHT.
// NO COPIAR este código fuente! El presente Código tienen derechos de autor.
// matheus-santiago@hotmail.com
// ==/UserScript==
// ==Profile==


// ==UserScript==
== Greasemonkey tutorials ==
// @name Ask.fm Auto Like by Gabriiel Santos
* [http://commons.oreilly.com/wiki/index.php/Greasemonkey_Hacks Greasemonkey hacks] (as a wiki)<br />
// @namespace                  http://userscripts.org/scripts/show/999999
** includes [[Avoid Common Pitfalls in Greasemonkey]]<br />Much more up-to-date than DiG above.
// @version 2.0
* [http://codebazaar.blogspot.com/2010/11/monkey-see-greasemonkey-do.html Monkey see, GreaseMonkey do!] - Video tutorial for GreaseMonkey userscript development
// @copyright         http://ask.fm/GabriielSantos1
// @description         Auto Like Ask.fm
// @author (http://userscripts.org/users/476758)
// @include http://ask.fm/*
// @icon http://s3.amazonaws.com/uso_ss/icon/138450/large.gif?1342345458
// Like Automatico Para Ask.FM
// Version numero 2
// DON'T COPY THIS SOURCE CODE!!! THIS CODE HAVE A COPYRIGHT.
// NO COPIAR este código fuente! El presente Código tienen derechos de autor.
// mentenovinho@live.com
// ==/UserScript==
// ==Profile==
body = document.body;
if(body != null) {
div = document.createElement("div");
div.setAttribute('id','like1');
div.style.position = "fixed";
div.style.display = "block";
div.style.width = "125px";
div.style.opacity= 1.00;
div.style.bottom = "+105px";
div.style.left = "+6px";
div.style.backgroundColor = "#ff00ae";
div.style.border = "1px solid #555";
div.style.padding = "2px";
div.innerHTML = "<div style='background-color: #00a2ff; color: #FFFFFF; border: 1px solid #00a2ff;'><center><a style='color: #000000;' <a href='http://www.facebook.com/Gabriiel Santoos' target='_blank' title='Me Adiciona ai :)'> Meu Facebook </a></div>"
div2 = document.createElement("div");
div2.setAttribute('id','spoiler');
div2.style.position = "fixed";
        div2.style.width = "125px";
div2.style.opacity= 0.90;
div2.style.bottom = "+65px";
div2.style.left = "+6px";
div2.style.backgroundColor = "#ff00ae";
div2.style.border = "1px solid #555";
div2.style.padding = "2px";
div2.innerHTML = "<div style='background-color: #00a2ff; color: #FFFFFF; border: 1px solid #00a2ff;'><a style='color: #FFFFFF;' onclick='spoiler()' title='Click Para Ocultar'>&laquo;</a> &#8226; <a href='http://ask.fm/GabriielSantos1' title='Pergunta ai :)' style='color: #FFFFFF;' onclick='alert(\'Thanks for install this script\');'>Segue e pergunta</a></div> "
body.appendChild(div);
body.appendChild(div2);
unsafeWindow.spoiler = function() {
var i;
for(i=1;i<=20;i++) {
var x=document.getElementById('like'+i);
if (x.style.display=="none") {
x.style.display="block";
div2.innerHTML = "<a onclick='spoiler()' title='Mostrar :) Minha Ask Matheus Felype'>&laquo;</a> &#8226; <a href='http://ask.fm/GabriielSantos1' title='Gabriel Santos'>Pergunta ai!</a>"
}
else {
x.style.display="none";
div2.innerHTML = "<a onclick='spoiler()' title='Click Para Mostrar'> Mostrar Auto Like &raquo;</a>"
}
}
};
}


// ==============
== JavaScript tutorials ==
// ==Like All==
body = document.body;
if(body != null) {
div = document.createElement("div");
div.setAttribute('id','like2');
div.style.position = "fixed";
div.style.display = "block";
div.style.width = "125px";
div.style.opacity= 0.90;
div.style.bottom = "+42px";
div.style.left = "+6px";
div.style.backgroundColor = "#eceff5";
div.style.border = "1px solid #94a3c4";
div.style.padding = "2px";
div.innerHTML = "<img src='https://lh4.googleusercontent.com/-D1HYuLwPnNQ/TxPK6cm_THI/AAAAAAAAAIE/ynATGaxGbv0/s16/Facebook%252520Like%252520Small.jpg' width='16' height='14' align='absmiddle' />&nbsp;&nbsp;<a onclick='OtomatisLike()'>Curtir 100!</a>"
body.appendChild(div);
unsafeWindow.OtomatisLike = function() {
document.getElementsByClassName("submit-button-more")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();
document.getElementsByClassName("like hintable")[0].click();


buttons = document.getElementsByTagName("button");
* [https://developer.mozilla.org/en/JavaScript/Guide Mozilla's JavaScript Guide]
for(i = 0; i < buttons.length; i++) {
* [http://www.tizag.com/javascriptT/ tizag's JavaScript Tutorial]
myClass = buttons[i].getAttribute("class");
* [http://www.quirksmode.org/js/contents.html JavaScript on QuirksMode]
if(myClass != null && myClass.indexOf("like") >= 0)
* The JavaScript Programming Language ([http://video.yahoo.com/watch/111593/1710507 part 1], [http://video.yahoo.com/watch/111594/1710553 2], [http://video.yahoo.com/watch/111595/1710607 3], [http://video.yahoo.com/watch/111596/1710658 4]) by Douglas Crockford<br />A set of videos of a wonderful lecture by this JavaScript guru.
if(buttons[i].getAttribute("name") == "likern false;")
* [http://blog.morrisjohns.com/javascript_closures_for_dummies.html JavaScript Closures for Dummies]
buttons[i].click();
* [http://www.jibbering.com/faq/faq_notes/closures.html JavaScript Closures]
}
 
== JavaScript references ==
};
Once familiar with the language, one may notice there are many available features in JavaScript which are initially hard to remember.
}
* [https://developer.mozilla.org/ MDC, an extensive wiki from Mozilla which details JavaScript and Firefox-unique features alike]
* [https://developer.mozilla.org/en/Gecko_DOM_Reference Gecko DOM Reference]
* [http://www.w3schools.com/jsref/ w3schools JS reference]
 
== JavaScript Books ==
* [http://www.oreilly.com/catalog/jscript5/ JavaScript: The Definitive Guide] is well regarded
* For a modern introduction to JavaScript, check out John Resig's [http://www.amazon.com/Pro-JavaScript-Techniques-John-Resig/dp/1590597273 Pro JavaScript Techniques]

Revision as of 22:32, 23 March 2013

Most of the information on this site is helpful. See the Greasemonkey Manual for starters.

Greasemonkey tutorials

JavaScript tutorials

JavaScript references

Once familiar with the language, one may notice there are many available features in JavaScript which are initially hard to remember.

JavaScript Books