Fix #5708 (Updated recipe for Gizmodo)

This commit is contained in:
Kovid Goyal 2010-06-05 12:19:24 -06:00
parent b935eb5e46
commit 1fc5cd26c8
2 changed files with 11 additions and 5 deletions

View File

@ -17,7 +17,7 @@ class Gizmodo(BasicNewsRecipe):
max_articles_per_feed = 100
no_stylesheets = True
encoding = 'utf-8'
use_embedded_content = True
use_embedded_content = False
language = 'en'
masthead_url = 'http://cache.gawkerassets.com/assets/gizmodo.com/img/logo.png'
extra_css = ' body{font-family: "Lucida Grande",Helvetica,Arial,sans-serif} img{margin-bottom: 1em} '
@ -29,9 +29,11 @@ class Gizmodo(BasicNewsRecipe):
, 'language' : language
}
remove_attributes = ['width','height']
remove_tags = [dict(name='div',attrs={'class':'feedflare'})]
remove_tags_after = dict(name='div',attrs={'class':'feedflare'})
remove_attributes = ['width','height']
keep_only_tags = [dict(attrs={'class':'content permalink'})]
remove_tags_before = dict(name='h1')
remove_tags = [dict(attrs={'class':'contactinfo'})]
remove_tags_after = dict(attrs={'class':'contactinfo'})
feeds = [(u'Articles', u'http://feeds.gawker.com/gizmodo/full')]

View File

@ -53,13 +53,17 @@ class Article(object):
@dynamic_property
def formatted_date(self):
def fget(self):
if self._formatted_date is None:
self._formatted_date = strftime(" [%a, %d %b %H:%M]",
t=self.localtime.timetuple())
return self._formatted_date
def fset(self, val):
self._formatted_date = val
if isinstance(val, unicode):
self._formatted_date = val
return property(fget=fget, fset=fset)
@dynamic_property