From 83d59d6b93a9300572c5f1adddca524baba5cb43 Mon Sep 17 00:00:00 2001 From: Marco Milanesi Date: Tue, 18 Oct 2011 22:21:43 +0200 Subject: [PATCH] revised github activity to adapt it to new github atom feed changes --- pelican/plugins/github_activity.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/pelican/plugins/github_activity.py b/pelican/plugins/github_activity.py index ba6cd70f..f2ba1da7 100644 --- a/pelican/plugins/github_activity.py +++ b/pelican/plugins/github_activity.py @@ -13,9 +13,20 @@ in your template just write a for in jinja2 syntax against the github_activity variable. - github_activity is a list containing raw html from github so you can - include it directly in your template + i.e. +
+

Github Activity

+ +
+ + github_activity is a list containing a list. The first element is the title + and the second element is the raw html from github """ from pelican import signals @@ -31,14 +42,20 @@ class GitHubActivity(): self.activities = feedparser.parse( generator.settings['GITHUB_ACTIVITY_FEED']) except ImportError: - raise Exception("unable to find feedparser") + raise Exception("Unable to find feedparser") def fetch(self): """ returns a list of html snippets fetched from github actitivy feed """ - return [activity['content'][0]['value'].strip() - for activity in self.activities['entries']] + + entries = [] + for activity in self.activities['entries']: + entries.append( + [element for element in [activity['title'], + activity['content'][0]['value']]]) + + return entries def fetch_github_activity(gen, metadata):