Added Twitter stream in front page (staging area).
[libreplanet-static.git] / server / staging / lp15 / fp.html
index d5af7a6d83bbaee881144288b6bda1daf61a26b0..f4f9162203bf764737905cc17b0ff2c11580ec17 100755 (executable)
@@ -163,6 +163,21 @@ and be part of LibrePlanet 2014!
 </p>
 <p>FSF members and students attend LibrePlanet at no cost! <a href="https://my.fsf.org/associate/support_freedom">Become a member now</a>.<!-- Registration opens in October sign up above to receive updates.--></p>
 
+<div class="row">
+  <div class="col-sm-6">
+       <ul id="lpstream" class="list-group margin-top">
+       </ul>
+       <script type="text/html" id="lpsTmpl">
+         <li class="list-group-item word-break">
+               <strong><!=publishedDate!> <!=author!></strong> <!=content!></li>
+       </script>
+  </div>
+  <div class="col-sm-6">
+       <div id="lpstream-twitter">
+       </div>
+  </div>
+</div>
+
 <!--#include virtual="/server/2015/footer.html"-->
 <!--#include virtual="/server/2015/common_js.html"-->
 <!--#include virtual="/server/2015/home_js.html"-->
@@ -173,17 +188,39 @@ and be part of LibrePlanet 2014!
 <script>
   $('#lpstream').feeds({
   feeds: {
+   fsf: 'https://status.fsf.org/api/statuses/user_timeline/440.rss',
    gs: 'http://status.fsf.org/api/statusnet/groups/timeline/393.rss',
   },
-  max: 4,
+  max: 2,
+  loadingTemplate: '<p>Loading GNU Social Stream...</p>',
   entryTemplate : 'lpsTmpl',
   preprocess : function(feed) {
     // Using moment.js to diplay dates as time ago
     this.publishedDate = moment(this.publishedDate).fromNow();
   },
   onComplete: function (entries) {
-    $('#lpstream').prepend('<li class="list-group-item"> <strong>LibrePlanet Stream</strong> </li>')
+    $('#lpstream').prepend('<li class="list-group-item"> <strong>LibrePlanet GNU Social Stream</strong> </li>')
   },
   });
 </script>
+<script src="/2015/assets/js/tweetie/tweetie.js">
+</script>
+<script type="text/javascript">
+  $('#lpstream-twitter').twittie({
+  hashtag: '#lp2015',
+  dateFormat: '%Y %m %d',
+  template: '<strong class="date">{{date}}</strong> -  {{date}} {{tweet}}',
+  count: 4,
+  loadingText: '<p>Loading Twitter Stream...</p>'
+  }, function() {
+     $('#lpstream-twitter ul').prepend('<li class="list-group-item"> <strong>LibrePlanet Twitter Stream</strong> </li>');
+     $('#lpstream-twitter ul').addClass('list-group margin-top');
+     $('#lpstream-twitter li').addClass('list-group-item word-break');
+  $('#lpstream-twitter li .date').each( function() {
+      $(this).text(moment($(this).text(), 'YYYY MM DD').fromNow());
+  });
+  }
+  );
+</script>
+
 <!--#include virtual="/server/2015/close.html" -->