Advertisement
mspotilas

New (2013) YouTube activity feed gadget, works with Opera

Nov 8th, 2013
330
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 2013
  11. // See http://yabtb.blogspot.com///
  12. // configuration:
  13. var ytfUserName = "mspotilas";
  14. var ytfLikesPLID = "LLstOtSJXzH4u6-FODxkQ_kA";
  15. var ytfMaxResults = 8;
  16. var ytfEmpty = "No entries";
  17. //
  18. $(document).ready(function() {
  19.   $.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=cb417f2abf5037653d5525a5d025a5ba&_render=json&max-results="+ytfMaxResults+"&plid="+ytfLikesPLID+"&user="+ytfUserName+"&_callback=?", function(response) {
  20.     var htm = "";
  21.     for(var i=0;i<response.count;i++) {
  22.       var item = response.value.items[i];
  23.       htm += '<div class="ytc';
  24.       if(i%2 == 1) htm += ' odd';
  25.       htm += '"><div class="ytc_thumb"><a target="_blank" href="' + item.link + '"><img title="' + item.title + '" src="' + item.thumb + '"/></a></div>';
  26.       htm += '<div class="ytc_title"><a target="_blank" href="' + item.link + '">' + item.title + '</a></div>';
  27.       htm += '<div class="ytc_description">' + item.description + '</div><div style="clear:both;"></div></div>';
  28.     }
  29.     if(htm == "") htm = ytfEmpty;
  30.     $("#ytfeed13").html(htm);
  31.   });
  32. });
  33. </script>
  34. <div id="ytfeed13"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement