amalgamatic-h5dcsched
Advanced tools
Comparing version 1.0.1 to 1.0.2
# 2014-10-21 | ||
4 commits against 3 issues, over 3 hours [`650e31f`](https://github.com/ucsf-ckm/amalgamatic-h5dcsched/commit/650e31f)⎆[`1e61845`](https://github.com/ucsf-ckm/amalgamatic-h5dcsched/commit/1e61845) | ||
## [**1.0.2**](https://github.com/ucsf-ckm/amalgamatic-h5dcsched/issues?milestone=2&state=closed) | ||
- [**#4**](https://github.com/ucsf-ckm/amalgamatic-h5dcsched/issues/4) Handle no speakers | ||
- [**#3**](https://github.com/ucsf-ckm/amalgamatic-h5dcsched/issues/3) Handle multiple speakers | ||
## Issues | ||
- [**#5**](https://github.com/ucsf-ckm/amalgamatic-h5dcsched/issues/5) better parsing, closes #3, closes #4 | ||
--- | ||
# 2014-10-21 | ||
5 commits against 2 issues, over 3 hours [`b057471`](https://github.com/ucsf-ckm/amalgamatic-h5dcsched/commit/b057471)⎆[`8e4a4aa`](https://github.com/ucsf-ckm/amalgamatic-h5dcsched/commit/8e4a4aa) | ||
@@ -3,0 +17,0 @@ |
17
index.js
@@ -43,2 +43,15 @@ var cheerio = require('cheerio'); | ||
var speakers = []; | ||
var room = ''; | ||
var myMess; | ||
thisMess.each(function (index, element) { | ||
myMess = $(element).text(); | ||
if (myMess.indexOf('Room: ') === 0) { | ||
room = myMess.substring(6); | ||
} | ||
if (myMess.indexOf('Speaker: ') === 0) { | ||
speakers.push(myMess.substring(9)); | ||
} | ||
}); | ||
var date = $(this).parent().children().first().text(); | ||
@@ -56,4 +69,4 @@ date = date.substring(date.indexOf(' ')+1); | ||
url: url.resolve(options.url, urlPath), | ||
speaker: thisMess.eq(1).text().substring(9), | ||
room: thisMess.eq(2).text().substring(6), | ||
speakers: speakers, | ||
room: room, | ||
start: start, | ||
@@ -60,0 +73,0 @@ end: end |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"scripts": { | ||
@@ -11,0 +11,0 @@ "test": "node_modules/lab/bin/lab -t 100" |
@@ -26,2 +26,3 @@ /*jshint expr: true*/ | ||
} | ||
nock.cleanAll(); | ||
@@ -42,3 +43,3 @@ nock.disableNetConnect(); | ||
name: 'Curing Cancer With HTML5', | ||
speaker: 'Rich Trott, UC San Francisco', | ||
speakers: ['Rich Trott, UC San Francisco'], | ||
room: 'E-131', | ||
@@ -107,5 +108,46 @@ start: '2014-10-21T17:00:00-07:00', | ||
expect(result).to.be.ok; | ||
sched.setOptions({url: 'http://html5devconf.com/schedule.html'}); | ||
done(); | ||
}); | ||
}); | ||
it('should handle no speakers', function (done) { | ||
nock('http://html5devconf.com') | ||
.get('/schedule.html') | ||
.replyWithFile(200, __dirname + '/fixtures/schedule.html'); | ||
sched.search({}, function (err, result) { | ||
expect(result.data).to.contain({ | ||
url: 'http://html5devconf.com/speakers.html', | ||
name: 'Overflow', | ||
speakers: [], | ||
room: 'E-133', | ||
start: '2014-10-20T09:00:00-07:00', | ||
end: '2014-10-20T09:20:00-07:00' | ||
}); | ||
done(); | ||
}); | ||
}); | ||
it('should handle multiple speakers', function (done) { | ||
nock('http://html5devconf.com') | ||
.get('/schedule.html') | ||
.replyWithFile(200, __dirname + '/fixtures/schedule.html'); | ||
sched.search({}, function (err, result) { | ||
expect(result.data).to.contain({ | ||
url: 'http://html5devconf.com/speakers/vlad_vukicevic.html#session', | ||
name: 'Virtual Reality & The Future of the Web (50min, Part 1)', | ||
speakers: ['Vlad Vukicevic, Mozilla', 'Josh Carpenter , Mozilla'], | ||
room: 'E-135', | ||
start: '2014-10-20T11:40:00-07:00', | ||
end: '2014-10-20T12:00:00-07:00' | ||
}); | ||
done(); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84662
187