Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mp3URL,content_type = self.getcontenturl(entry)
if mp3URL:
if entry.has_key( "modified_parsed" ):
try:
time_epoch = time.mktime( entry.modified_parsed )
except TypeError:
#this is for feeds that advertise pubDate but don't create entries
try:
grabber = downloadURL( mp3URL, basedir, tmpdir,bittorrent=self.options["bittorrent"], bandwidth=self.bandwidth, content_type=content_type )
except IOError:
self.makefeedlogentry( None )
continue
entry["grabber"] = grabber
if grabber.info.has_key( "last-modified" ):
if feedparser._parse_date( grabber.info["last-modified"] ):
time_epoch = time.mktime( feedparser._parse_date( grabber.info["last-modified"] ) )
else:
time_epoch = feed_count
feed_count = feed_count - 1
else:
time_epoch = feed_count
feed_count = feed_count - 1
else:
logger.info("No pubDate information for " + self.title)
#podcasts which don't use pubDate use a fake time. These feeds end up getting
#read from top to bottom like they would if we were not ordering by time
try:
grabber = downloadURL( mp3URL, basedir, tmpdir, bittorrent=self.options["bittorrent"], bandwidth=self.bandwidth, path=self.options["path"], content_type=content_type )
except (KeyboardInterrupt, SystemExit):
sys.exit()
except Exception:
self.makefeedlogentry( None )
pass
if VERBOSE >= 2:
print rj
if (not r.ok) or rj['count'] < 1:
if VERBOSE > 0:
print "The docket ENTRY doesn't exist. " + \
"We need to fake one up."
need_fake_entry = True
# #4. If necessary, we fake the docket entry and case title.
if need_fake_case or need_fake_entry:
# Either because of the case docket or the docket entry's absence
# we must fake up a docket.
date = time.strftime('%m/%d/%Y',
feedparser._parse_date(published_date))
html = ''
html += '<h3>THIS IS A FAKED UP DOCKET VIA RSS THROUGH '
html += 'recapupload.py<br>\n'
html += '%s</h3>\n' % docket_number
html += ''
if need_fake_case:
html += '<table><tbody><tr><td><br>%s' % docket_caption
# Lack of whitespace after this colon matters!
html += '</td><td>Date Filed:</td></tr></tbody></table>\n'
html += ''
html += ''
html += '\n'
html += ''
html += '\n' % date
html += '\n' % (url, entry_number)
html += '' % text<table><tbody><tr><td>Date Filed</td><th>#</th><td>Docket Text</td></tr><tr><td>%s</td><td><a href="%s">%s</a></td><td>%s</td></tr></tbody></table>
def t(dateString):
t = feedparser._parse_date(dateString)
return datetimefromparsed(t).isoformat() if t else None
def parse_date(s):
return struct_to_datetime(feedparser._parse_date(s))
def struct_to_datetime(s):
def parse_date(s):
return struct_to_datetime(feedparser._parse_date(s))
def struct_to_datetime(s):
def parse_date(s):
return struct_to_datetime(feedparser._parse_date(s))
def struct_to_datetime(s):
def __init__(self, item, parent):
self.__gobject_init__()
try:
"Apparently some feed items don't have any dates in them"
self.date = item['date']
self.date_parsed = item['date_parsed']
except:
item['date'] = self.date = time.ctime()
self.date_parsed = feedparser._parse_date(self.date)
self.title = item['title'].encode('utf8')
self.summary = item['summary'].encode('utf8')
self.link = item['link']
self.parent = parent
self.unread = True
def parse_date(s):
return struct_to_datetime(feedparser._parse_date(s))
def struct_to_datetime(s):