Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string apiUrl = "https://pastebin.com/api/api_post.php";
- string apiKey = "your_api_key_here"; // Replace with your actual API key
- string pasteTitle = "Example Paste from LSL";
- string pasteContent = "This is a test paste created from an LSL script.";
- string pasteFormat = "text"; // Change to your preferred format
- integer pastePrivacy = 0; // 0 = Public, 1 = Unlisted, 2 = Private
- string pasteExpire = "10M"; // Expiration time (N = Never, 10M = 10 Minutes, etc.)
- default
- {
- state_entry()
- {
- llOwnerSay("Starting paste creation...");
- string postData = llDumpList2String([
- "api_dev_key=" + apiKey,
- "api_option=paste",
- "api_paste_code=" + llEscapeURL(pasteContent),
- "api_paste_name=" + llEscapeURL(pasteTitle),
- "api_paste_format=" + pasteFormat,
- "api_paste_private=" + (string)pastePrivacy,
- "api_paste_expire_date=" + pasteExpire
- ], "&");
- llHTTPRequest(apiUrl, [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], postData);
- }
- http_response(key id, integer status, list metadata, string body)
- {
- if (status == 200)
- {
- llOwnerSay("Paste created successfully: " + body);
- }
- else
- {
- llOwnerSay("Failed to create paste. Status: " + (string)status + ", Response: " + body);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement