Skip to content
Permalink
Browse files

Minor cosmetic change to song list, and expand compatibility for host…

… matching regex
  • Loading branch information...
ironman5366 committed Apr 22, 2019
1 parent 320ecab commit 0848813223c191b58e14f0f7ba3c0c79dfc82f53
Showing with 15 additions and 5 deletions.
  1. +2 −0 index.html
  2. +13 −5 page.js
@@ -54,6 +54,8 @@ <h1>Currently On</h1>
<div class="col-md-12">
<div class="row">
<h1>Songs</h1>
</div>
<div class="row">
<div id="songs">
</div>
<div>
18 page.js
@@ -9,7 +9,7 @@ const spotify_api = require('./spotify_api.json');
// The RegEx to resolve student images from the directory
const DIR_REG = new RegExp('(<div class="email"><span class="icon">' +
'\\n{0,1}<\\/span>(\\w+)&nbsp;)|<span class="icon"><\\/span><a href="mailto:(\\w+)@carleton.edu">');
const HOST_REG = new RegExp('(\\S+) (\\S+ ){0,1}(\\S+) \'(\\d\\d)');
const HOST_REG = new RegExp('(\\S+) ([^\\s\\d]+ )+(\'(\\d\\d)?|)|(\\S+) (\\S+)');
let curr_songs = [];
let spotify_auth = null;
let song_queries = {
@@ -26,10 +26,18 @@ let auth_missed = 0;
*/
function get_host_widget(host_str){
let parsed_host_str = HOST_REG.exec(host_str);
console.log("Parsed");
let first_name = parsed_host_str[1];
let last_name = parsed_host_str[3];
let class_year = "20"+parsed_host_str[3];
let first_name = null;
let last_name = null;
let class_year = null;
try{
first_name = parsed_host_str[1];
last_name = parsed_host_str[2];
class_year = "20"+parsed_host_str[3];
}
catch (error) {
first_name = parsed_host_str[5];
last_name = parsed_host_str[6];
}
let username= null;
let data = $.get({
url: 'https://apps.carleton.edu/campus/directory/?first_name='+first_name+'&last_name='+last_name+'' +

0 comments on commit 0848813

Please sign in to comment.
You can’t perform that action at this time.