Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sports reporters script now defaults to yesterday #4

Merged
merged 1 commit into from
Apr 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions sports-reporters/sports-reporters
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parser = argparse.ArgumentParser(description='Find a czaban podcast'
parser.add_argument('--hour', type=int, default=1,
help='Show hour to play')
parser.add_argument('--yesterday', action='store_true')
parser.add_argument('--date', default=datetime.date.today().strftime('%m-%d-%y'),
parser.add_argument('--date', default=(datetime.date.today() - datetime.timedelta(1)).strftime('%m-%d-%y'),
help='Date to search for, in format mm-dd-yy')
parser.add_argument('--url', default='http://cdn.stationcaster.com/stations/wtem/rss/21783.rss',
help='URL for RSS feed')
Expand Down Expand Up @@ -79,23 +79,6 @@ while not url:
url = entry.link
log.debug("Found mp3 url: {}".format(url))

"""
# https://audioboom.com/boos/4078524-1-19-2016-czaban-hour-1
# Add the date passed in as an argument to the date_formats list
date_formats.append(args.date)
for date in date_formats:
log.debug("Searching for date format '{}'...".format(today.strftime(date)))
match = re.search("https://audioboom.com/boos/"
".*-{}-czaban-hour-{}".format(
today.strftime(date),
args.hour),
html)
if match and match.group(0):
url = match.group(0)
log.debug("Found URL of {}".format(url))
break
"""

if url is None:
msg = "Hour {} ({}) not found".format(args.hour, str(args.date))
if args.exit_if_not_found:
Expand Down