Created
May 5, 2011 05:42
-
-
Save mattpat/956593 to your computer and use it in GitHub Desktop.
Closure black magic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for x in entrySelectors: | |
datetext = x.select('.//pubDate/text()').extract() | |
datetext = u'0000-00-00 00:00:00+00:00' if len(datetext)<1 else dateutil.parser.parse(datetext[0]) | |
templist = x.select('.//link["nytimes.com/"]/text()').extract() | |
if len(templist)>0 : | |
def cb(tx): | |
return lambda r: self.check_call(r, tx) | |
links.append(templist[0]) | |
#tx = str(copy.deepcopy(datetext)) | |
newitem = Request(templist[0], callback=cb(datetext)) | |
itemlist.append( newitem) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment