A javascript module to scrap online judge and retrieve informations.
npm install --save ojscraper
const ojscraper = require('ojscraper');
ojscraper.getProblemInfo({
ojname: 'uva',
problemID: '100'
})
.then(function(info){
console.log(info);
//Prints title, pid and link in json format
})
Only promise is returned. Callback is not supported.
There is only method supported currently:
It accepts an object as parameter. The object must have the following two fields: ojname
and problemID
. Look below for possible values of ojname
and their corresponding problemID formats.
- Codeforces: 'cf'
- SPOJ: 'spoj'
- Uva Online Judge: 'uva'
Well, that's it for now.
problemID
must match the following regex:
- cf:
^\\d+[A-Z]
- spoj:
^[A-Z0-9_]+$
- uva:
^\\d{3,5}$
- Add more oj
- Implement
getUserInfo(options)