Skip to content

Commit

Permalink
Merge pull request #73 from AceFire6/jethro/add/black_lightning
Browse files Browse the repository at this point in the history
Add Black Lightning
  • Loading branch information
AceFire6 authored Nov 8, 2018
2 parents 0eece33 + f242a75 commit f39f43b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ordering/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
LEGENDS_URL = "List_of_DC's_Legends_of_Tomorrow_episodes"
SUPERGIRL_URL = 'List_of_Supergirl_episodes'
VIXEN_URL = 'List_of_Vixen_episodes'
BLACK_LIGHTNING_URL = 'Black_Lightning_(TV_series)'

FANDOM_ROOT = 'http://arrow.fandom.com/wiki/'
WIKIPEDIA_ROOT = 'https://en.wikipedia.org/wiki/'
Expand Down Expand Up @@ -65,6 +66,12 @@
'url': VIXEN_URL,
'root': FANDOM_ROOT
},
{
'id': 'black-lightning',
'name': 'Black Lightning',
'url': BLACK_LIGHTNING_URL,
'root': WIKIPEDIA_ROOT
},
)

SHOW_DICT = {SHOWS[i]['id']: SHOWS[i] for i in range(len(SHOWS))}
Expand Down
8 changes: 8 additions & 0 deletions ordering/static/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ a.btn {
background-color: #be3915;
}

.black-lightning {
background-color: #464340;
}

.black-lightning:hover {
background-color: #383532;
}

.no-color {
background-color: transparent;
color: #000;
Expand Down
15 changes: 13 additions & 2 deletions ordering/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,20 @@ def get_episode_list(series_soup, series):
for row in table.getText().split('\n\n') if row.strip()
]
else:
table_heading = table.find(name='tr', class_=None)
table_headings = [
heading.getText().replace(' ', '').lower()
for heading in table_heading.children
]
episode_num_index = table_headings.index('no.inseason')
title_index = table_headings.index('title')
air_date_index = table_headings.index('originalairdate')

wikipedia_row_unpacker = itemgetter(episode_num_index, title_index, air_date_index)

table = [
[j.getText() for j in itemgetter(1, 3, 5, 11)(i.contents)]
for i in table.find_all(class_='vevent')
[episode_row_col.getText() for episode_row_col in wikipedia_row_unpacker(episode_row.contents)]
for episode_row in table.find_all(class_='vevent')
]

for row in table:
Expand Down

0 comments on commit f39f43b

Please sign in to comment.