Skip to content

Commit

Permalink
fix getShowTitles (same31#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
bennieboj authored and same31 committed Apr 15, 2019
1 parent 063b7b7 commit 73766df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/getShowTitles.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ function getShowTitles () {
};

return request({
uri: helpers.addic7edURL + '/shows.php',
uri: helpers.addic7edURL,
headers: headers
}).then(function (body) {
// Find all show titles
// -------------------------------------------------
var regexp = /<a href="\/show\/\d*">([^<]*)<\/a>/gm;
var regexp = /<option value="\d+" >([^<]*)<\/option>/gm;
let match,
showTitles = [];
while ((match = regexp.exec(body)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (match.index === regexp.lastIndex) {
regexp.lastIndex++;
}
showTitles.push(match[1]);
showTitles.push(match[1].replace('&amp;', '&'));
}

return showTitles;
Expand Down

0 comments on commit 73766df

Please sign in to comment.