1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Skript get Text from URL

Discussion in 'Skript' started by BimoYudistira, Jun 5, 2022.

Tags:
Thread Status:
Not open for further replies.
  1. BimoYudistira

    BimoYudistira Member

    Joined:
    Jul 5, 2017
    Messages:
    1
    Likes Received:
    0
    I dont know what happen when i get text from url i got different text

    my code:

    Code (Text):
    1. command /ttvoter:
    2.     trigger:
    3.         if sender is console:
    4.             # send request to "https://minecraft-mp.com/api/?object=servers&element=voters&key=NPanfpvEAdcWGwVYTmTM9qEKdd9xwU6cHQ&month=previous&format=json"
    5.             # map json last response's body to {_response::*}
    6.             # message "%{_response::*}%"
    7.         else:
    8.             if name of player is "ManiMonster":
    9.                 send a "get" request to "https://minecraft-mp.com/api/?object=servers&element=voters&key=NPanfpvEAdcWGwVYTmTM9qEKdd9xwU6cHQ&month=previous&format=json"
    10.                 set {_topvote} to last response's body
    11.                 message "%{_topvote}%"
    12.             else:
    13.                 stop
    The Result:
    [​IMG]

    Result should be:

    Code (Text):
    1. {
    2. "name": "SANTOS CRAFT",
    3. "address": "play.santos-mc.my.id",
    4. "month": "202205",
    5. "voters": [
    6. {
    7. "nickname": "NamaKokUdin",
    8. "votes": "20"
    9. },
    10. {
    11. "nickname": "daxero27",
    12. "votes": "16"
    13. },
    14. {
    15. "nickname": "Minus0Minus",
    16. "votes": "14"
    17. },
    18. {
    19. "nickname": "Predtod",
    20. "votes": "12"
    21. },
    22. {
    23. "nickname": "HAVIER",
    24. "votes": "12"
    25. },
    26. {
    27. "nickname": "Ilhamrecpta",
    28. "votes": "11"
    29. },
    30. {
    31. "nickname": "sypoi",
    32. "votes": "10"
    33. },
    34. {
    35. "nickname": "xPeria_",
    36. "votes": "9"
    37. },
    38. {
    39. "nickname": "Rawndivzn",
    40. "votes": "6"
    41. },
    42. {
    43. "nickname": "Aristo1223",
    44. "votes": "5"
    45. },
    46. {
    47. "nickname": "YukiNoHikari",
    48. "votes": "5"
    49. },
    50. {
    51. "nickname": "lantang",
    52. "votes": "5"
    53. },
    54. {
    55. "nickname": "f0rsakeN",
    56. "votes": "5"
    57. },
    58. {
    59. "nickname": "SAYURSEHAT",
    60. "votes": "5"
    61. },
    62. {
    63. "nickname": "Tudeyshow",
    64. "votes": "4"
    65. },
    66. {
    67. "nickname": "divo",
    68. "votes": "4"
    69. },
    70. {
    71. "nickname": "OtsutsukiDeden",
    72. "votes": "4"
    73. },
    74. {
    75. "nickname": "Emily_Abel",
    76. "votes": "4"
    77. },
    78. {
    79. "nickname": "DedenAddryn",
    80. "votes": "4"
    81. },
    82. {
    83. "nickname": "Rey677",
    84. "votes": "3"
    85. },
    86. {
    87. "nickname": "AF7",
    88. "votes": "3"
    89. },
    90. {
    91. "nickname": "Druldect",
    92. "votes": "3"
    93. },
    94. {
    95. "nickname": "Hasion",
    96. "votes": "2"
    97. },
    98. {
    99. "nickname": "Depressant_",
    100. "votes": "2"
    101. },
    102. {
    103. "nickname": "RayhanaHumayra",
    104. "votes": "2"
    105. },
    106. {
    107. "nickname": "Ryn432",
    108. "votes": "2"
    109. },
    110. {
    111. "nickname": "Aanpro111",
    112. "votes": "2"
    113. },
    114. {
    115. "nickname": "DivaCH",
    116. "votes": "1"
    117. },
    118. {
    119. "nickname": "ytedit",
    120. "votes": "1"
    121. },
    122. {
    123. "nickname": "adm10202",
    124. "votes": "1"
    125. },
    126. {
    127. "nickname": "MarcoZenitsu",
    128. "votes": "1"
    129. },
    130. {
    131. "nickname": "PitriQueen",
    132. "votes": "1"
    133. },
    134. {
    135. "nickname": "KotakTisu",
    136. "votes": "1"
    137. },
    138. {
    139. "nickname": "AntiWibu",
    140. "votes": "1"
    141. },
    142. {
    143. "nickname": "kejaa",
    144. "votes": "1"
    145. },
    146. {
    147. "nickname": "streroze",
    148. "votes": "1"
    149. },
    150. {
    151. "nickname": "Zarkrep",
    152. "votes": "1"
    153. },
    154. {
    155. "nickname": "DreamTheSpeedrun",
    156. "votes": "1"
    157. },
    158. {
    159. "nickname": "akuproooo",
    160. "votes": "1"
    161. },
    162. {
    163. "nickname": "EnderGonD",
    164. "votes": "1"
    165. },
    166. {
    167. "nickname": "FahmiMupi",
    168. "votes": "1"
    169. },
    170. {
    171. "nickname": "Akifpro123",
    172. "votes": "1"
    173. },
    174. {
    175. "nickname": "Ryuu2592008",
    176. "votes": "1"
    177. },
    178. {
    179. "nickname": "Ezii",
    180. "votes": "1"
    181. },
    182. {
    183. "nickname": "AbaySans",
    184. "votes": "1"
    185. },
    186. {
    187. "nickname": "PemburuVillage",
    188. "votes": "1"
    189. },
    190. {
    191. "nickname": "putri_ch",
    192. "votes": "1"
    193. },
    194. {
    195. "nickname": "LyrzWhyz",
    196. "votes": "1"
    197. }
    198. ]
    199. }
    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
    --- Double Post Merged, Jun 6, 2022, Original Post Date: Jun 5, 2022 ---
    Nevermind i fix this shit, I using uncolored for fix the url

    here my code:

    Code (Text):
    1.             set {_testaa} to uncolored "https://minecraft-mp.com/api/?object=servers&&eelement=voters&&kkey=NPanfpvEAdcWGwVYTmTM9qEKdd9xwU6cHQ&&mmonth=previous&&fformat=json"
    2.             message "%{_testaa}%"
    3.             send request to uncolored "https://minecraft-mp.com/api/?object=servers&&eelement=voters&&kkey=NPanfpvEAdcWGwVYTmTM9qEKdd9xwU6cHQ&&mmonth=previous&&fformat=json    "
    4.             set {_topvote} to last response's body
    5.             message "%{_topvote}%"
    I already change my API key, so dont worry about that
     
Thread Status:
Not open for further replies.

Share This Page

Loading...