How can I access a raw private paste from pastebin?

MetaDark picture MetaDark · Nov 5, 2012 · Viewed 13.9k times · Source

I know how to generate a user key using the pastebin API, but how can I use this userkey to access a raw private paste?

I am using Lua for this.

Answer

MBlanc picture MBlanc · Jun 7, 2014

Obtaining the raw paste bin output is not part of of the Pastebin API:

This option is actually not part of our API, but you might still want to use it. To get the RAW output of a paste you can use our RAW data output URL:

http://pastebin.com/raw.php?i=

Simply add the paste_key at the end of that URL and you will get the RAW output.

Since private pastes can only be seen by the user who created them, my guess is that they use the logincookie for authentication. In that case, you'll need to send it with the HTTP request.


In respect to implementing this in Lua, (since you haven't said which library you're using) I'm gonna go forth and recommend the HTTP module in LuaSocket or the wonderful Luvit (http://luvit.io).