// TwitPic Greasemonkey Script // ====================================== // Copyright �2008 Twitpic // Version 1.0 beta // ====================================== // ==UserScript== // @name TwitPic // @namespace http://twitpic.com/ // @description Share photos on Twitter // @include http://twitter.com/* // @include http://*.twitter.com/* // @include https://twitter.com/* // ==/UserScript== function addThumb(el, img_id) { newel = document.createElement("div"); newel.style.margin = "25px 10px"; el.parentNode.parentNode.appendChild(newel); newel.innerHTML = "<a rel=\"twitpic_gm\" href=\"http://twitpic.com/" + img_id + "\"><img style=\"border: 1px solid #CCCCCC;\" src=\"http://twitpic.com/" + img_id + "-thumb\" border=\"0\" /></a>"; } function findPosts() { posts = new Array(); tmp = document.getElementsByTagName("span"); for(i=0;i<tmp.length;i++) { if(tmp[i].className == "meta entry-meta" || tmp[i].className == "entry-content") { posts[posts.length] = tmp[i]; } } tmp = document.getElementsByTagName("tr"); for(i=0;i<tmp.length;i++) { if(tmp[i].className == "hentry" || tmp[i].className == "hentry_hover") { posts[posts.length] = tmp[i]; } } for(i=0;i<posts.length; i++) { atmp = posts[i].getElementsByTagName("a"); for (j=0;j<atmp.length;j++) { aloc = atmp[j].href; if(aloc.indexOf("http://twitpic.com/") > -1 && atmp[j].rel != "twitpic_gm") { tmp2 = aloc.split(".com/"); var re = new RegExp("[^a-z0-9]+"); if(!tmp2[1].match(re) && tmp2[1] != '') { addThumb(atmp[j], tmp2[1]); } } } } } findPosts();
Register or Login
Public API
Terms/Privacy
Business Card Designs