Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliandavidmr/uhunt-node
Get information of exercises from UVA Judge
https://github.com/juliandavidmr/uhunt-node
node-module nodejs npm-package uhunt uva uva-data
Last synced: 28 days ago
JSON representation
Get information of exercises from UVA Judge
- Host: GitHub
- URL: https://github.com/juliandavidmr/uhunt-node
- Owner: juliandavidmr
- License: mit
- Created: 2017-03-11T22:29:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-02T10:52:24.000Z (over 7 years ago)
- Last Synced: 2024-09-23T01:14:31.192Z (about 2 months ago)
- Topics: node-module, nodejs, npm-package, uhunt, uva, uva-data
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/uhunt-node
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uhunt
Get information of exercises from UVA Judge and uHunt.
API Public: *http://uhunt.felix-halim.net/api*
## Install
```js
$ npm install uhunt --save
```## Use
### Specific problem
```js
// Get by id excercise
uhunt.byId(161).then((data) => {
console.log(data);
/* =>
{ pid: 161,
num: 225,
title: 'Golygons',
ce: 98,
re: 164,
tle: 297,
mle: 1,
wa: 1077,
ac: 618,
rtl: 3000,
... }
*/
}, error => {
console.log(error);
})
``````js
// Get by number excercise
uhunt.byNum(100).then((data) => {
console.log(data);
/* =>
{ pid: 36,
num: 100,
title: 'The 3n + 1 problem',
ce: 113277,
re: 68349,
ole: 323,
tle: 59086,
mle: 5209,
wa: 275293,
pe: 5049,
ac: 195269,
rtl: 3000,
... }
*/
}, error => {
console.log(error);
})
```### User submissions
```js
// Get data submissions from any user
uhunt.getUserSubmission(339).then((data) => {
console.log(data);
}, error => {
console.log(error);
})
```### Problem List
Returns the list of problems at UVa in array format.
```js
// Get list excersices
uhunt.list().then((data) => {
console.log(data);
}, error => {
console.log(error);
})
```### Submissions to Specific Problems
To view submissions to specific problems on a given submission date range. Note that the submissions are returned in no particular order.
```js
uhunt.listSubmSpecificProblem([1342, 2702, 1700], new Date(2004, 12, 15), Date.now()).then((data) => {
console.log(data);
/*
[{ sid: 3308738,
uid: 1137,
pid: 1342,
ver: 50,
lan: 3,
run: 10096,
mem: 0,
rank: -1,
sbt: 1108576139,
name: 'Hubert Hwang',
uname: 'antimatter' },
...
]
*/
}, error => {
console.log("ERROR", error);
})
```### _In progress_
Author: [@anlijudavid](https://github.com/juliandavidmr/)
**Pull requests accepted**
Licence MIT