Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var rp = require("request-promise");
- var fs = require("fs-extra");
- var item = { //Paar daten als beispiel. "data" hält am Ende alle neuen infos
- name: "AK-47 | Redline (Field-Tested)",
- shortName: "AK-47 | Redline (FT)",
- inspect: "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20M2096895882184785298A15699827149D12557388178881307451",
- data: {}
- }
- function apiCall(inUri){
- const options = {
- uri: inUri,
- headers: {
- 'User-Agent': 'Request-Promise'
- },
- json: true
- };
- return rp(options)
- }
- async function getAllInfo(item) {
- const sales = await apiCall("https://skins.w1z0.xyz/?t=cfab5cccbc94e3e8&name=" + item.name);
- const wear = await apiCall("https://api.csgofloat.com/?url=" + item.inspect);
- const overpay = await apiCall("http://188.166.72.201:8000/check?item=" + item.shortName);
- Promise.all([sales, wear, overpay]).then(results => {
- item.data.sales = results[0];
- item.data.wear = results[1];
- item.data.overpay = results[2];
- fs.outputJSON('item.json',item).then( () => {
- console.log(" >>> Saved");
- })
- })
- }
- getAllInfo(item);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement