✓ Accepted answer
Jill, did you review the Pastebin API?
Posting to Pastebin requires an application/x-www-form-urlencoded POST format.
My little Pastebin API I made a while ago:
local API='http://www.pastebin.com/api/api_post.php';
local HTTPService=game:service'HttpService';
local strf=string.format;
function pastebin_get(paste_id)
return HTTPService:getAsync(
strf('http://www.pastebin.com/raw.php?i=%s',tostring(paste_id)),
true
);
end;
function pastebin_post(dev_key,user_key,paste_name,paste_code)
local Data={
'api_option=paste';
strf('api_user_key=%s',tostring(user_key));
'api_paste_private=1';
strf('api_paste_name=%s',HTTPService:UrlEncode(
tostring(paste_name or 'Misc'))
);
'api_paste_expire_data=N';
'api_paste_format=lua';
strf('api_dev_key=%s',tostring(dev_key));
strf('api_paste_code=%s',HTTPService:UrlEncode(
tostring(paste_code))
);
};
Data=table.concat(Data,'&');
local Result=HTTPService:postAsync(API,Data,2);
print('Results: '..Result);
return(Result);
end;
The dev_key is your developer key on Pastebin.
Note, this may not work, for I just fixed it.(I don't use it, I have my own site to hold data)
8 comments
So your local API Would be my API? Or my paste?
Um, no. The API would be the Pastebin API PHP script page. :L Read the API article on Pastebin, please. It is not possible to edit a paste, though you can get it's contents, delete it, and repost it with the new data.
Oh.. kk Thank's diitto! ;D
I have no idea why my stats reset. I guess a website script error? It was at 22 and when I loged back on after 2 days it was -2!
Maybe you got -24 :(
I looked at my rep and I didnt get a -24. :/ Must be a website coding error.
Diitto is there a way to use PostAsync on stypi? :3
Nope.