function Badge() { this.list_author= ''; this.list_name = ''; this.tweets = 0; this.partner = ''; this.title = true; this.subscribers= true; this.followers = true; this.keywords = ''; this.operator = 'or'; this.template = 'medium'; this.width = null; this.height = null; this.getUrl = function() { var keywords_string = escape(this.keywords); this.list_author.replace('@',''); // base_url = 'http://localhost.listiti.com/'; base_url = 'http://widgets.listimonkey.com/'; query = 'widget/badge/'+this.list_author+'/'+this.list_name; params = '?title='+this.title+'&followers='+this.followers+'&subscribers='+this.subscribers+'&template='+this.template+'&keywords='+keywords_string+'&operator='+this.operator+'&partner='+this.partner; if(this.tweets>0) params += '&tweets='+this.tweets; url = base_url + query + params; return url; } this.updateSize = function() { // If height and width have have been manually specified, we don't override them if(this.height && this.width) return; if(this.template=='plain') { this.width = 45; if(this.title) this.width += 60+7*(this.list_author+this.list_name).length; this.height=20; } if(this.template=='box') { this.width = 110; if(this.title) this.width += 20+7*(this.list_author+this.list_name).length; this.height=22; } if(this.template=='tiny') { this.width = 274; this.height=70; } if(this.template=='small') { this.width = 190; this.height= 85; } if(this.template=='medium' || this.template=='channels') { this.width = 230; this.height= 95; } if(!this.title && this.height>35) this.height-=15; } this.write = function() { url = this.getUrl(); this.updateSize(); document.write(''); } }