Solved Skript get Text from URL

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

BimoYudistira

Member
Jul 5, 2017
1
0
1
25
I dont know what happen when i get text from url i got different text

my code:

Code:
command /ttvoter:
    trigger:
        if sender is console:
            # send request to "https://minecraft-mp.com/api/?object=servers&element=voters&key=NPanfpvEAdcWGwVYTmTM9qEKdd9xwU6cHQ&month=previous&format=json"
            # map json last response's body to {_response::*}
            # message "%{_response::*}%"
        else:
            if name of player is "ManiMonster":
                send a "get" request to "https://minecraft-mp.com/api/?object=servers&element=voters&key=NPanfpvEAdcWGwVYTmTM9qEKdd9xwU6cHQ&month=previous&format=json"
                set {_topvote} to last response's body
                message "%{_topvote}%"
            else:
                stop

The Result:
HMcM0Rn.png


Result should be:

Code:
{
"name": "SANTOS CRAFT",
"address": "play.santos-mc.my.id",
"month": "202205",
"voters": [
{
"nickname": "NamaKokUdin",
"votes": "20"
},
{
"nickname": "daxero27",
"votes": "16"
},
{
"nickname": "Minus0Minus",
"votes": "14"
},
{
"nickname": "Predtod",
"votes": "12"
},
{
"nickname": "HAVIER",
"votes": "12"
},
{
"nickname": "Ilhamrecpta",
"votes": "11"
},
{
"nickname": "sypoi",
"votes": "10"
},
{
"nickname": "xPeria_",
"votes": "9"
},
{
"nickname": "Rawndivzn",
"votes": "6"
},
{
"nickname": "Aristo1223",
"votes": "5"
},
{
"nickname": "YukiNoHikari",
"votes": "5"
},
{
"nickname": "lantang",
"votes": "5"
},
{
"nickname": "f0rsakeN",
"votes": "5"
},
{
"nickname": "SAYURSEHAT",
"votes": "5"
},
{
"nickname": "Tudeyshow",
"votes": "4"
},
{
"nickname": "divo",
"votes": "4"
},
{
"nickname": "OtsutsukiDeden",
"votes": "4"
},
{
"nickname": "Emily_Abel",
"votes": "4"
},
{
"nickname": "DedenAddryn",
"votes": "4"
},
{
"nickname": "Rey677",
"votes": "3"
},
{
"nickname": "AF7",
"votes": "3"
},
{
"nickname": "Druldect",
"votes": "3"
},
{
"nickname": "Hasion",
"votes": "2"
},
{
"nickname": "Depressant_",
"votes": "2"
},
{
"nickname": "RayhanaHumayra",
"votes": "2"
},
{
"nickname": "Ryn432",
"votes": "2"
},
{
"nickname": "Aanpro111",
"votes": "2"
},
{
"nickname": "DivaCH",
"votes": "1"
},
{
"nickname": "ytedit",
"votes": "1"
},
{
"nickname": "adm10202",
"votes": "1"
},
{
"nickname": "MarcoZenitsu",
"votes": "1"
},
{
"nickname": "PitriQueen",
"votes": "1"
},
{
"nickname": "KotakTisu",
"votes": "1"
},
{
"nickname": "AntiWibu",
"votes": "1"
},
{
"nickname": "kejaa",
"votes": "1"
},
{
"nickname": "streroze",
"votes": "1"
},
{
"nickname": "Zarkrep",
"votes": "1"
},
{
"nickname": "DreamTheSpeedrun",
"votes": "1"
},
{
"nickname": "akuproooo",
"votes": "1"
},
{
"nickname": "EnderGonD",
"votes": "1"
},
{
"nickname": "FahmiMupi",
"votes": "1"
},
{
"nickname": "Akifpro123",
"votes": "1"
},
{
"nickname": "Ryuu2592008",
"votes": "1"
},
{
"nickname": "Ezii",
"votes": "1"
},
{
"nickname": "AbaySans",
"votes": "1"
},
{
"nickname": "PemburuVillage",
"votes": "1"
},
{
"nickname": "putri_ch",
"votes": "1"
},
{
"nickname": "LyrzWhyz",
"votes": "1"
}
]
}

can someone help me how to fix this code, i have no clue for this one. i always get Error: no parameters while the text is not like that. Here my console debug https://pastebin.com/uR0Rgd5L
[doublepost=1654490653,1654443515][/doublepost]Nevermind i fix this shit, I using uncolored for fix the url

here my code:

Code:
            set {_testaa} to uncolored "https://minecraft-mp.com/api/?object=servers&&eelement=voters&&kkey=NPanfpvEAdcWGwVYTmTM9qEKdd9xwU6cHQ&&mmonth=previous&&fformat=json"
            message "%{_testaa}%"
            send request to uncolored "https://minecraft-mp.com/api/?object=servers&&eelement=voters&&kkey=NPanfpvEAdcWGwVYTmTM9qEKdd9xwU6cHQ&&mmonth=previous&&fformat=json    "
            set {_topvote} to last response's body
            message "%{_topvote}%"

I already change my API key, so dont worry about that
 
Status
Not open for further replies.