Harry Rose

Home » PHP » Pastebin

Pastebin

The pastebin can be seen live (and used if you want to) at http://paste.harryrose.org. There isn't much documentation for it yet but I've written a C# app that I will upload soon and also a python script that is available from here.

The site is able to output pastes in a number of formats such as RSS, XML and JSON (for a more up to date list see the pastebin homepage) and implements a RESTful interface (as I've already mentioned). You can basically use it as follows.

To post a new paste send an HTTP POST request to http://paste.harryrose.org/paste/. On success you should be redirected to the URL that contains your paste, otherwise you will receive an HTTP error code describing what went wrong. To view a single paste you go to http://paste.harryrose.org/paste/someNumber.someFormat, where someNumber is the ID of the paste and someFormat is the extension of the format you would like to receive the pastes in. For example http://paste.harryrose.org/paste/100.xml. If you do not specify a format XML is assumed. At the moment if you specify a format that doesn't exist you just get some plain text saying "Bad Format" back - this is a bug, I need to work out what error code would be best to return.

If you would like to see the most recent pastes to be made to the pastebin (that still exist) you can use the url http://paste.harryrose.org/pastes/last/someNumber.someFormat where someNumber is now how many of the most recent pastes you would like to receive and someFormat is the same as above. For example http://paste.harryrose.org/pastes/last/5.json will retrieve the 5 most recent pastes that exist in the database and serve them up as JSON.