Hi guys,
I want to start a series of Lessons/Tutorials on Temper Monkey.
What is Temper Monkey?
Temper Monkey is Chrome Extensions.
https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en
It allows you to run your custom javascript on some page (for example this page)
What this can be used for?
- You can adjust the websites you view to your needs (for example block specific ad)
- You can create additional buttons that will do additional things (for example you could add to Steem button that will send a tip of 0.001 SBD when you click on it)
- For Hacking.
- Bots and automated tasks - this is my favorite usage, and I will show you how to create one in next tutorials (so make sure you follow haha)
So lets Start
After you got Chrome Browser (yeah you need one to install Chrome Extension)
and install the plugin, you will see it at top right corner like this:
Lets click on it
You will see this -
Lets click on Create new script!
Lets for example take some article to play on, lets assume I pick this one -
https://steemit.com/life/@davidconstantine/the-cake-riddle-how-to-cut-it-so-everyone-will-stay-happy
Now in
, I will insert it so it will look like this:
( tells when temper monkey should work)
Next Step - Include JQuery
JQuery is javascript library, that allows you with few lines write lots of code (abstraction they say haha)
we do it by adding the line:
// http://code.jquery.com/jquery-3.2.1.min.js
You can add it after on new line
So eventually it should look like this:
Now We Ready To Put Some Magic In!!!
If you've been to my riddle article, you've see I wrote
"Hey my dear friends,"
lets change it to
"Hey my dear monkeys"
This is done by the following code:
$(".PostFull__body").html($(".PostFull__body").html().replace('friends','monkeys'));
Result should look like this, and then click Ctrl+S to save - be default it will be turned on
So after going to
https://steemit.com/life/@davidconstantine/the-cake-riddle-how-to-cut-it-so-everyone-will-stay-happy
You will see that friends changes to monkeys LOL
Thats it for this lesson, others will be built on what we learned here, and we will go on more advanced stuff.
Resteem, upvote, enjoy and have fun with it :)
Some javascript experience is needed, but you can do this by copy-paste haha
See ya next time my Monkes ;)