Created
June 30, 2011 17:01
-
-
Save champierre/1056668 to your computer and use it in GitHub Desktop.
An user script that adds Twitter button and Facebook Like button to Scratch project pages. You can use this as Chrome extension or as a greasemonkey script for Firefox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @title Scratch Plus | |
| // @description Add Twitter button and Facebook Like button to Scratch project pages. | |
| // @namespace http://tsukurusha.com | |
| // @include http://scratch.mit.edu/projects/* | |
| // ==/UserScript== | |
| var pactions = document.getElementById('pactions'); | |
| var buttons = document.createElement('div'); | |
| var twitter_button = document.createElement('span'); | |
| twitter_button.innerHTML = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?text=' + encodeURIComponent(document.title) + '" style="width:110px; height:21px;"></iframe>'; | |
| var facebook_like_button = document.createElement('span'); | |
| facebook_like_button.innerHTML = '<iframe src="http://www.facebook.com/plugins/like.php?app_id=235188349839830&href=' + encodeURIComponent(document.location.href) + '&send=false&layout=button_count&width=200&show_faces=false&action=like&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:21px;" allowTransparency="true"></iframe>'; | |
| buttons.appendChild(twitter_button); | |
| buttons.appendChild(facebook_like_button); | |
| pactions.appendChild(buttons); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment