Commit 696ee638 authored by colm's avatar colm

re-enabling the osp blog feed using feedparser in python rather than the FeedEk plugin in js

parent d8d983a4
......@@ -9,7 +9,9 @@ django-appconf==1.0.1
django-celery==3.1.16
django-compressor==1.4
django-cors==0.1
feedparser==5.2.1
kombu==3.0.26
pygit==0.1
pytz==2015.4
six==1.9.0
wsgiref==0.1.2
......@@ -74,16 +74,6 @@
<script src="{{ STATIC_URL }}js/jquery.hoverIntent.minified.js"></script>
<script>
jQuery(document).ready(VC.annotations.init());
</script>
<script type="text/javascript">
$('#on-the-table-feed').FeedEk({
FeedUrl : 'http://ospublish.constantvzw.org/blog/feed',
MaxCount : 3,
ShowDesc :true,
ShowPubDate:true,
DateFormat: 'dddd, Do MMMM YYYY - hh:mm',
DateFormatLang: 'en'
});
</script>
<!--Script to show/hide layers of different content at the time when the-->
......
......@@ -14,8 +14,16 @@
of them and <a href="http://en.wikipedia.org/wiki/Copyleft#Applying_copyleft">release your improvements</a>.
<br>Nous sommes embarqués.
<a href="{{ HOST }}/about">Read more about the way we work</a></p>
<h1><a href="http://ospublish.constantvzw.org/blog/">Latest notes from&nbsp;the&nbsp;blog</a></h1>
<div id="on-the-table-feed"></div>
<h1><a href="http://ospublish.constantvzw.org/blog/">Latest posts on &nbsp;the&nbsp;blog</a></h1>
<div id="on-the-table-feed">
<ul>
{% for entry in ospblog %}
<li><a href="{{entry.link}}">{{entry.title}}</a>
<p>{{entry.summary}}</p>
</li>
{% endfor %}
</ul>
</div>
{% include "incl-newsletter.html" %}
</div>
......
......@@ -3,11 +3,14 @@
<use xlink:href="{{ STATIC_URL }}img/OSP_new-frog.svg#svg5365"></use>
</svg>
</a>
<ul id="menu">
<li>
<h1><a href="/">Open Source Publishing</a></h1>
<br>
</li>
<!-- <li class="collapse"><a href="#">Menu</a></li> -->
<!-- <div class="hide-on-mobile"> -->
<li><a href="{{ HOST }}/tools/">Tools</a></li>
<li><a href="{{ HOST }}/foundry/">Foundry</a></li>
<li><a href="{{ HOST }}/workshop/">Workshops</a></li>
......@@ -17,4 +20,5 @@
<!--<li><a href="http://ospublish.constantvzw.org/images/">Images</a></li>-->
<li><a href="{{ HOST }}/about">info</a></li>
<!--<li><a href="http://ospublish.constantvzw.org/contact">Contact</a></li>-->
<!-- </div> -->
</ul>
......@@ -8,6 +8,7 @@ from django.template import RequestContext
from django.core.urlresolvers import reverse, NoReverseMatch
from datetime import datetime
from math import log1p
import feedparser
import settings
......@@ -35,6 +36,9 @@ def format_commits(commits_to_format):
return commits
def home(request):
ospblog = feedparser.parse('http://ospublish.constantvzw.org/blog/feed')
ospblog = ospblog.entries[:3]
print(ospblog)
data = get_api('home')
repos = []
for repo in data:
......@@ -58,8 +62,9 @@ def home(request):
r['commits'] = format_commits(r['commits'])
repos.append(r)
return render_to_response('home.html',
{ 'repos' : repos, "said": said, 'vc_url' :settings.VC_URL },
{ 'ospblog' : ospblog, 'repos' : repos, "said": said, 'vc_url' :settings.VC_URL },
context_instance=RequestContext(request))
def category(request, category):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment