diff --git a/README.md b/README.md index 8fc2a06..5cc8058 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,12 @@ GET `hsr?id=PLAYER_ID` GET `hi?id=PLAYER_ID` **Contoh:** https://api.isan.eu.org/nickname/hi?id=10000001 +### Punishing: Gray Raven (AP, EU, NA) +GET `pgr?id=ID&zone=SERVER_ID` + +Keterangan untuk identifikasi server: AP(Asia-Pasifik), EU(Europe), NA(North America) + +**Contoh:** https://api.isan.eu.org/nickname/pgr?id=16746755&zone=AP ### Sausage Man GET `sm?id=PLAYER_ID` @@ -83,5 +89,7 @@ https://api.isan.eu.org/nickname/ml?id=1007909047&zone=13044&decode=false Contoh penggunaan `?decode=true` https://api.isan.eu.org/nickname/ml?id=1007909047&zone=13044&decode=true atau https://api.isan.eu.org/nickname/ml?id=1007909047&zone=13044 (sama saja). +## Monitoring +API monitoring [UptimeRobot](https://stats.uptimerobot.com/s9axzR77Fm) # Copyright © Projek ini dibawah lisensi: [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/), tidak terafiliasi dengan Codashop diff --git a/index.js b/index.js index 7e0400a..6d8f18a 100644 --- a/index.js +++ b/index.js @@ -12,6 +12,31 @@ async function callAPI(request) { if (!id) { return `{"success":false,"message":"Bad Request"}` } + if (path.includes('/pgr')) { + if (zone.toLowerCase().includes('ap')) { + sn = 'Asia-Pacific' + sv = '5000' + } else if (zone.toLowerCase().includes('eu')) { + sn = 'Europe' + sv = '5001' + } else if (zone.toLowerCase().includes('na')) { + sn = 'North America' + sv = '5002' + } else { + return `{"success":false,"message":"Bad request"}` + } + const body = `voucherPricePoint.id=259947&voucherPricePoint.price=15136.0&voucherPricePoint.variablePrice=0&user.userId=${id}&user.zoneId=${sv}&voucherTypeName=PUNISHING_GRAY_RAVEN&shopLang=id_ID` + const request = new Request(endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body + }) + const response = await fetch(request) + const data = await response.json() + return `{"success":true,"game":"Punishing: Gray Raven","server":"${sn}","id":${id},"name":"${data.confirmationFields.username}"}` + } if (path.includes('/hsr')) { if (id. startsWith('6')) { sn = 'America'