Skip to content

Instantly share code, notes, and snippets.

@Gummibeer
Last active December 4, 2017 13:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gummibeer/4b6bba72b822566253cf1f7f3a81a462 to your computer and use it in GitHub Desktop.
Save Gummibeer/4b6bba72b822566253cf1f7f3a81a462 to your computer and use it in GitHub Desktop.
This script plants trees by botting Ecosia search
Array.prototype.random = function() {
return this[Math.floor(Math.random() * this.length)];
};
var properties = [
'car',
'house',
'phone',
'money'
];
var products = [
'smartphone',
'computer',
'laptop',
'car',
'house',
'gaming console',
'bicycle',
'motorcycle'
];
var activities = [
'bike',
'swimm',
'cook',
'drive',
'dive',
'chill',
'party'
];
var templates = [
'where is my %property',
'how much costs a %product',
'best place to %activity'
];
function generate(){
return templates
.random()
.replace('%property', properties.random())
.replace('%product', products.random())
.replace('%activity', activities.random());
}
setTimeout(function() {
document.getElementsByClassName('search-form-input')[0].value = generate();
document.getElementsByClassName('search-form')[0].submit();
}, 30 * 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment