@wfcd/arsenal-parser
Version:
Parser for Digital Extreme's Twitch Arsenal Extension data
33 lines (22 loc) • 2.96 kB
Markdown
Parse the Warframe Arsenal Twitch extension data into useable javascript objects.
[](https://github.com/WFCD/banner/blob/main/PROJECTS.md)
[](https://coveralls.io/github/WFCD/arsenal-parser?branch=main)
[](https://travis-ci.com/WFCD/arsenal-parser)
[](https://discord.gg/jGZxH9f)
Documentation is available [here](https://wfcd.github.io/arsenal-parser/)
```javascript
import ArsenalData from 'ArsenalParser.js';
import fetch from 'node-fetch.js';
const baseURL = 'https://content.warframe.com/dynamic/twitch/getActiveLoadout.php?account=';
async function fetchArsenal(username) {
// Fetch the data for the specified username
const data = await fetch(baseURL + encodeURIComponent(username.toLowerCase()))
.then((res) => res.json());
if (data.errors) {
throw new Error(data.errors);
}
return new ArsenalData(data);
}
```