AtomicUs5000 logo
as seen on...
Home
Services
Blog
Forum
Videos
Downloads
Tools
Links
Contact
Store
Sitemap

TOOLS - YOUTUBE CHANNEL BADGE

Tools


 

Use the YouTube Channel Badge Generator to get an embed code of your YouTube Channel.

Enter your channel, color setting, and then update the preview and code.

The javascript code is for people that own their own websites, or have hosted sites that allow javascript to be used. The javascript code will always stay up to date with your current statistics.

The HTML code alternative can be used anywhere, but it will not update on its own. If you use the HTML code, you will have to stop by every once in awhile to get an updated code. This code will work on sites like MySpace.

Please post any questions or problems in the forum here:
YouTube Channel Badge Generator Forum


Enter YouTube Channel Name
Select Badge Font:
Select Colors
border color:  
badge color:  
info box color:  
text color:  
link color:  

preview
JAVASCRIPT CODE (auto-updates): copy and paste
<script type="text/javascript">
<!--
function commaAdd(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } function fixDate(theDate) {theYr=theDate.substr(0,4);theMo=theDate.substr(5,2);theDa=theDate.substr(8,2);return theMo+'/'+theDa+'/'+theYr;} function pA(a,b,c,d) {return 'padding:'+a+'px '+b+'px '+c+'px '+d+'px;">';} function showChannel(data) { entry = data.entry || []; user = entry.yt$username.$t; cat = entry.category[0].term; if (cat!=='Guru' && cat!=='Standard' && cat!=='Musician' && cat!=='Comedian' && cat!=='Director' && cat!=='Non-Profit' && cat!=='Reporter' && cat!=='Politician') {cat = entry.category[1].term;} joined = fixDate(entry.published.$t.substr(0, 10)); try {thumb = entry.media$thumbnail.url;} catch(err){thumb = 'http://www.youtube.com/img/no_videos_140.jpg';} views = commaAdd( entry.yt$statistics.viewCount); subs = commaAdd( entry.yt$statistics.subscriberCount); watched = commaAdd( entry.yt$statistics.videoWatchCount); videos = commaAdd( entry.gd$feedLink[5].countHint); tL = 'http://www.youtube.com/profile?user='+ user;TE='</td></tr>'; WW = 'http://www.'; OM = 'onmouse'; VI = 'videos';TF='</table>'; AT = '<a target="_blank" href="'; TB = '<table cellspacing="'; ST = ' style="'; TD = '<td'+ST;TR='<tr>'; WI = 'width:'; YT = 'youtube'; Ft = 'arial'; Ft2 = 'font:12px '+Ft+';'; B2 = 'border'; CL = 'color'; B1 = B2+':1px solid '; BG = 'background'; CC = '#BEBEBE'; BC = '#666666'; LC = '#660000'; IC = '#DEDEDE'; TC = '#333333'; document.write(TB,'0"',ST,B2,':5px ridge ',BC,';',BG,'-',CL,':',CC,';width:auto;">',TR,TD,WI,'100%;text-align:left;vertical-align:top"',pA(0,0,0,0),TB,'6" ',ST,'width:100%">',TR,TD,'vertical-align:top;',B1,BC,';height:122px;',BG,'-',CL,':#FFF;">',TB,'0"',ST,'text-align:center;">',TR,TD,pA(4,4,4,4),AT, WW,YT,'.com/" title="visit ',YT,'"><img src="',WW,YT,'.com/img/pic_',YT,'logo_123x63.gif" alt="',YT,' Logo"',ST,WI,'82px;height:42px;',B2,':none" />',TE,TR,'<td>',AT,tL,'" title="',user,' on ',YT,'"><img src="',thumb,'"',ST,WI,'80px;height:60px;',B1,BC,';" alt="',user,' on ',YT,'" />', TE,TR,TD,pA(0,4,4,4),AT,WW,YT ,'.com/subscription_center?add_user=', user,'"',ST,'font:10px ',Ft,';text-decoration:none;',CL,':#003;" title="subscribe to ',user,'"><div',ST,'cursor:pointer;',BG,'-',CL,':#FFCC11;',B2,':3px outset #FFCC11;',WI,'82px;margin:auto;" ',OM ,'over="this.style.',BG,'Color=\'#FFFF00\'" ',OM ,'out="this.style.',BG,'Color=\'#FFCC11\'" ',OM ,'up="this.style.',B2,'Style=\'outset\'" ',OM ,'down="this.style.',B2,'Style=\'inset\'">SUBSCRIBE</div></a>',TE,TF,'</td>',TD,'vertical-align:top;',WI,'100%;',B1,BC,';height:122px;',BG,'-',CL,':',IC,'">',TB,'0"',ST,'text-align:center;',WI,'100%;',CL,':',TC,'">',TR,TD,pA(6,6,0,6),AT,tL,'" title="',user,' on ',YT,'"',ST,'font:bold 12px ',Ft,';',CL,':',LC,'">',user ,'</a>',TE,TR,TD ,'font:small-caps 10px ',Ft,';',pA(0,6,6,6),'( ',cat,' )',TE,TR,TD,Ft2,pA(0,6,0,6),'joined ',joined,TE,TR,TD,Ft2,pA(0,6,0,6),views,' channel views',TE, TR,TD,Ft2,pA(0,6,0,6),subs,' subscribers',TE, TR,TD,Ft2,pA(0,6,4,6),watched,' ',VI,' watched',TE,TR, TD,pA(0,6,2,6),AT,tL,'&view=',VI,'" title="see all of ',user,'\'s ',VI,'"',ST,Ft2,CL,':',LC,'">',videos,' public ',VI,'</a>',TE,TR,'<td id="',user,'VID"',ST,Ft2,pA(0,6,2,6),'see latest video',TE,TF,TE, TF,TE,TR,TD,'text-align:center;',pA(2,2,2,2),AT, WW,'atomicus5000.com/tools/YouTube_Channel_Badge.php" title="get your ',YT,' channel badge"',ST,'font:10px ',Ft,';',CL,':',LC,';">get your ',YT,' channel badge</a>',TE,TF); hID = document.getElementsByTagName("head")[0];nSc = document.createElement('script');nSc.type = 'text/javascript';nSc.src = 'http://gdata.'+YT+'.com/feeds/api/users/'+user+'/uploads?v=2&alt=json-in-script&callback=latestVid&orderby=published&start-index=1&max-results=1';hID.appendChild(nSc); } function latestVid(data) {tV = WW+YT+'.com/watch?v=' + data.feed.entry[0].media$group.yt$videoid.$t; document.getElementById(user + 'VID').innerHTML = AT+tV+'" title="'+user+'\'s latest video"'+ST+Ft2+CL+':'+LC+'">see latest video</a>';}
//-->
</script>
<script type="text/javascript" src="http://gdata.youtube.com/feeds/api/users/AtomicUs5000?v=2&amp;alt=json-in-script&amp;callback=showChannel"> </script>
HTML CODE (does not update): copy and paste