/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// // CONFIGURATION // ////////////////////////////////////////////////////////// string SHORT_URL = "sales"; string API_KEY = "A1364788-B702-4413-B937-7A57E32B43CE"; /////////////////////////////////////////////////////////////////////////// // INTERNALS // /////////////////////////////////////////////////////////////////////////// key uReq = NULL_KEY; string llURL = ""; default { state_entry() { uReq = llHTTPRequest("http://grimore.org/SIM/registerURL.php?action=retrieve&apiKey=" + API_KEY + "&shortURL=" + SHORT_URL, [HTTP_METHOD, "GET"], ""); return; } http_response(key reqID, integer status, list metadata, string body) { if (uReq == reqID) { llHTTPResponse(uReq, 200, "OK"); llURL=body; state retrieved; } } } state retrieved { state_entry() { llOwnerSay("URL is: " + llURL); } }