#!/usr/bin/python -tt # -*- coding: utf-8 -*- # # This script can update the title page from any RSS feed, but concrete # adjustments are done specifically to Fedora Planet. # # It replaces the content between # and in _site/index.html. The file # path of index.html can be passed as an argument. # # Usage: # # ./rss.py _site/index.html from __future__ import print_function import codecs import os import sys import feedparser import re import sys feedparser.sanitizer._HTMLSanitizer.unacceptable_elements_with_end_tag.add('
'): article_desc = '
%s
' % article_desc except AttributeError: print ('AttributeError. Going to next item') continue # we got # Tue, 20 Oct 2015 03:28:42 +0000 # But we expect # Tue, 20 Oct 2015 article_date = ' '.join(item.updated.split()[:4]) HTML += u"""