valish / mma-api Goto Github PK
View Code? Open in Web Editor NEWMMA Fighter API in NodeJS
License: MIT License
MMA Fighter API in NodeJS
License: MIT License
I'm not sure if you're aware, but there are 6 vulnerabilities found here:
https://nodesecurity.io/check/mma
I would suggest switching from request
to node-fetch
if possible.
I run these cammands
var mma = require('mma');
var name = process.argv[2] + " " + process.argv[3];
mma.fighter(name, function(data){
console.log(JSON.stringify(data));
});
and I get the following error
/home/user/node_modules/request/index.js:44
throw new Error('undefined is not a valid uri or options object.')
^
Error: undefined is not a valid uri or options object.
at request (/home/user/node_modules/request/index.js:44:11)
at Object.module.exports.getFighter (/home/user/node_modules/sherdog/lib/sherdog/index.js:16:3)
at /home/user/node_modules/mma/lib/mma/index.js:105:13
at Request._callback (/home/user/node_modules/mma/node_modules/google/lib/google.js:85:7)
at Request.self.callback (/home/user/node_modules/request/request.js:185:22)
at Request.emit (events.js:182:13)
at Request. (/home/user/node_modules/request/request.js:1161:10)
at Request.emit (events.js:182:13)
at IncomingMessage. (/home/user/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:273:13)
this might be probably a flaw in the API.
have missing record data.
My guess is there will be more missing data. I'll use this issue to log all missing data.
First thing that pops out when reading the README is that the sample data for Jon Jones is incorrect.
He's got 1 total loss loss but it's not categorized as anything. It should be an "other".
"losses": { "total": 1, "knockouts": 0, "submissions": 0, "decisions": 0, "others": 0 }
The problem is that sherdog-api always returns 0 for that particular field. I've submitted a pull request that fixes the issue
Hey running this code with your test
var mma = require('mma');
mma.fighter("Jon Jones", function(data) { console.log(data)});
Is returning
home/danielokita/Scripts/mma/node_modules/request/index.js:44
throw new Error('undefined is not a valid uri or options object.')
Il try and go in and fix it but just letting you know
After following the steps to install from source code when I run the command:
var mma = require('mma');
the output is: "Error cannot find module 'mma'
all other module seems to be created in the node_modules folder and I can run the sherdog one fine but mma is non existent.
Anyone else experiencing this issue?
Hey,
I just tried for the first time using your api, but I could not do it correctly.
This is my code in React:
import React from "react";
import mma from "mma";
function App() {
mma.fighter("Jon Jones", (data: any) => {
console.log(data);
});
return <div className="App">ss</div>;
}
export default App;
When running the app I get the following error:
TypeError: querystring.escape is not a function
Keep in mind, I am using typescript.
Forgive me if this is a dumb question, I am a node noob.
If I query for a fighter and that query returns no links (like query mma.fighter('asdfkjaskdfjaksdjf', function
...), Currently what I get back is a response that shows:
Error: undefined is not a valid uri or options object.
at request (/home/username/github/telegram/proj/node_modules/request/index.js:46:11)
at Object.module.exports.getFighter (/home/username/github/telegram/proj/node_modules/sherdog/lib/sher
dog/index.js:16:3)
at /home/username/github/telegram/proj/node_modules/mma/lib/mma/index.js:105:13
at Request._callback (/home/username/github/telegram/proj/node_modules/google/lib/google.js:85:7)
at Request.self.callback (/home/username/github/telegram/proj/node_modules/request/request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/home/username/github/telegram/proj/node_modules/request/request.js:1044:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
I'm just not sure if this is the expected behavior or not. Thanks :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.