Advertisement
mspotilas

YouTube activity feed gadget for Blogger, works with Opera

May 21st, 2012
1,028
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script src='http://code.jquery.com/jquery-latest.js' type='text/javascript'></script>
  2. <style type="text/css">
  3. div.ytc {clear:both;padding:5px;font-size:11px;}
  4. div.ytc.odd {background-color: #eee;}
  5. div.ytc_thumb {position:relative;float:right;margin-left:4px;line-height:1;}
  6. div.ytc_thumb img {width:69px;height:52px;border:1px solid #888;}
  7. div.ytc_title {font-weight:bold;}
  8. </style>
  9. <script type='text/javascript'>
  10. // YouTube Activity Feed Gadget by MS-potilas 2012
  11. // See http://yabtb.blogspot.com/2012/05/another-gadget-for-youtube-activity.html
  12. // configuration:
  13. var ytfUserName = "mspotilas";
  14. var ytfMaxResults = 8;
  15. var ytfAllow = "";
  16. var ytfDisallow = "";
  17. var ytfEmpty = "No entries";
  18. //
  19. $(document).ready(function() {
  20.   $.getJSON("http://run.pipes.yahoo.com/pipes/pipe.run?_id=58c841d14337ba4fbf693abd9701dc49&_render=json&max-results="+ytfMaxResults+"&allow="+ytfAllow+"&disallow="+ytfDisallow+"&user="+ytfUserName+"&_callback=?", function(response) {
  21.     var htm = "";
  22.     for(var i=0;i<response.count;i++) {
  23.       var item = response.value.items[i];
  24.       htm += '<div class="ytc';
  25.       if(i%2 == 1) htm += ' odd';
  26.       htm += '"><div class="ytc_thumb"><a target="_blank" href="' + item.link + '"><img title="' + item.title + '" src="' + item.thumb + '"/></a></div>';
  27.       htm += '<div class="ytc_title"><a target="_blank" href="' + item.link + '">' + item.title + '</a></div>';
  28.       htm += '<div class="ytc_description">' + item.description + '</div><div style="clear:both;"></div></div>';
  29.     }
  30.     if(htm == "") htm = ytfEmpty;
  31.     $("#ytfeed").html(htm);
  32.   });
  33. });
  34. </script>
  35. <div id="ytfeed">Loading...</div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement