View Single Post
06/16/20, 01:39 AM   #2
remosito
AddOn Author - Click to view addons
Join Date: Dec 2019
Posts: 30
Might be the path won't do me any good...

just found out that RequestOpenUnsafeURL() seems to not open URLs of the type "file:///path"

Any way to circumvent that?

Alternatively:

- Any way to create a json post request with lua that will run?
- Anybody would by chance know a free place to host a http get request parameter to json send message wrapper html page?

crude version:
Lua Code:
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.   <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>Display Leads - Location Updater</title>
  7.   </head>
  8.   <body onload="sendMessage()">
  9.     Your Location Data update has been sent. <br>Many thanks!
  10.    
  11.   </body>
  12.  
  13.   <script>
  14.  
  15.     const queryString = window.location.search;
  16.     console.log(queryString);
  17.     const urlParams = new URLSearchParams(queryString);
  18.     var pa = urlParams.get('a')
  19.    
  20.     function sendMessage() {
  21.       var request = new XMLHttpRequest();
  22.       request.open("POST", "https://discord.com/api/webhooks/722214307370238005/_8RkXXwvQQ_LDsDD40_s-UR_X0sPdabmgkQ6ovMmQ8mYd9LzZbTGoIzuZeHkb-kay4VL");
  23.  
  24.       request.setRequestHeader('Content-type', 'application/json');
  25.  
  26.       var params = {
  27.         username: "rdlupdates",
  28.         avatar_url: "",
  29.         content: pa
  30.       }
  31.  
  32.       request.send(JSON.stringify(params));
  33.     }
  34.   </script>
  35. </html>
  Reply With Quote