Skip to content

Instantly share code, notes, and snippets.

@sidonath
Created February 4, 2009 17:41
Show Gist options
  • Save sidonath/58230 to your computer and use it in GitHub Desktop.
Save sidonath/58230 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name twitter Komplimenti
// @namespace http://z3c.info/
// @description Daje komplimente korisniku
// @include http://twitter.com/home
// ==/UserScript==
$ = unsafeWindow.jQuery;
var MessageProvider = new (function () {
var messages = [
"Wow! You <strong>are</strong> awesome!",
"Aww... you are soo cuute",
"Damn, you're the smartest girl evah!!!",
"Every moment spent with you is LEGEN... wait for it... DARY!"
];
// return random integer in interval [min, max)
function random(min, max) {
return Math.floor(Math.random()*(max - min) + min);
}
this.get = function() {
var index = random(0, messages.length);
return messages[index];
};
})();
$("<li/>")
.addClass("hentry")
.addClass("status")
.append($("<span/>")
.addClass("thumb")
.addClass("vcard")
.addClass("author")
.append($("<a/>")
.append($("<img/>")
.addClass("photo")
.addClass("fn")
.attr("width", "48")
.attr("height", "48")
.attr("src", "http://img16.imageshack.us/img16/1237/companioncube2007101609yj8.jpg")
)
)
)
.append($("<span/>")
.addClass("status-body")
.append($("<strong/>")
.append($("<a/>")
.attr("title", "Komplimentator")
.append("komplimentator")
)
)
.append(" ")
.append($("<span/>")
.addClass("entry-content")
.append(MessageProvider.get())
)
)
.prependTo("#timeline")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment