Access Pastebin's Code Snippets and Hacker Rants via API

Allen Tipper
Aug. 16 2011, 08:00AM EDT

As a developer, good ways to store those often-reused snippets of code that correctly solve a common problem is always useful. Now, there are other solutions to this problem, such as the Snipt API, which I covered previously, but Pastebin.com is the most often used, perhaps because it has beeb the favored place for notes from hacker group LulzSec. Pastebin has a nice, full-featured API, and is simple and free to use, at least at a basic level.

Pastebin's popularity is due to a number of factors. TheNextWeb wrote a nice story talking about why Pastebin is so popular, especially among hackers. From their story:

As social network use became more widespread, interest in Pastebin began to pick up also. Although the service was originally created to share bits of source code and chat logs, members of Twitter – the world’s most popular microblogging service – started to use Pastebin to write messages that were longer than 140 characters, linking to the “pastes” in their Twitter posts.

In just over a year, Vader developed additional features to extend the reach of Pastebin, providing browser extensions, smartphone and tablet apps and desktop applications. With new tools introduced and the release of Pastebin V3, users began creating pastes from their mobiles and other platforms, utilising the service to create quick and easy To-Do lists.

Its API page is only viewable with a free account, obtainable at its sign up page. Once you've made an account, head on over to the API page to look at the documentation. The service is RESTful, with responses in either plaintext or XML. The code examples on the site, which offer pretty simple implementations, are all done in PHP and cURL.

Pastebin offers both a free service and a paid service. The paid service is remarkably cheap, and makes things a little easier. For more details on that, look here. One could put the API to lots of interesting little uses, perhaps making an app that backed up pastes with the Evernote API.

Allen Tipper Allen Tipper is a Computer Science generalist with a wide range of interests. After graduating in 2008, he's been programming for and specializing in mobile devices, as well as social media websites. As a programmer, APIs are rather important to him, as he finds using them in his software amazingly fun.

Comments

Comments(1)

User HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

I believe Pastebin is so popular because it was what we were using a decade ago in IRC chats to share code.