Snipplr API Working Again


Published in: API, NewsPosted by Tyler on 05/31/07


I’ve been pulling my hair out for the last day trying to figure out why the Snipplr XML-RPC API went down. I noticed that it happened around the time Dreamhost upgraded to PHP 5.2.2. but couldn’t track down the exact cause.

This post from Daniel Jalkut’s blog was the first I had heard of other websites (like every WordPress blog) having similar issues. Turns out, a bug in PHP 5.2.2 makes $HTTP_ RAW_ POST_DATA not set by default. And since the XML-RPC library I rely on uses that variable, kablooey! Goodbye API!

In any case, it’s fixed now.


Snipplr Command Line Interface


Published in: PluginsPosted by Tyler on 05/14/07


Avinash Vora has written a command line interface for Snipplr. It lets you post snippets on any system that supports Python. SnipplrCLI is released under the GNU GPL. Head over to his site and give it a try.


New Snipplr TextMate Bundle (Beta)


Published in: Brainstorming, Development, News, PluginsPosted by Tyler on 05/09/07


Today I want to share with everyone a beta version of a new TextMate bundle I’m working on for Snipplr. It’s a major improvement over the old bundle.

Previously, it would pop-up a box for you to type in some keywords. Then it would search Snipplr and show you a list of matching snippets you could insert into your document. That worked pretty well, but you had to be online for it to communicate with Snipplr. You’d lose access to your snippets if you weren’t connected to the net.

This new version syncs your snippets and favorites directly into TextMate’s bundle menu – giving you offline access to all your code stored in Snipplr. If you don’t mind me saying so, this rocks. Here’s a screen shot:

picture-1.png

Keep in mind that this bundle is still in development. Everything is working fine for me, but your mileage may vary. You can download the new bundle here. Note: You must be logged in to Snipplr for the download to work. Also, make sure you uninstall the old bundle from TextMate before installing this one.

For the nerds in the audience…

This bundle was a lot of fun to write because it forced me to dig into TextMate’s bundle format. I’ve written some advanced bundles before (at least I consider them to be . . . at work we use a bundle that lets us stage and deploy our clients’ websites on remote servers via TextMate) but nothing like this.

When you download the bundle from Snipplr, PHP generates a custom bundle on the fly based on the snippets in your account. It creates all the .tmSnippet and .tmCommand files as well as the OS X property listings. It’s by no means brain surgery, but it definitely took some tinkering to make it come out right.

The bundle also includes a command to refresh itself. It does this by downloading a new bundle in the background and rsync’ing it with the pristine copy stored in TextMate. I consider this a cheap hack – I’m hoping TextMate 2.0 provides an official API for bundles to self-update. (Ideally, each bundle .plist would contain a URL and version number that TextMate could use to search for updates and, if available, update the bundle à la Firefox extensions. You there, Allan? :) ) It tells TextMate to update its bundle listing using a quick AppleScript command (osascript -e 'tell app "TextMate" to reload bundles').

There’s probably a better way to do all this – I need to search the TextMate mailing list.

Next up, I’m going to try and register the update command with launchd so the bundle can stay in sync automatically – preferably when TextMate isn’t active.

I’d appreciate any feedback from the Snipplr community on this bundle. Bugs and feature requests are always welcome.

Also, if anyone is interested in beta testing the new version of Snipplr we’re working on, let me know.


Snipplr API Updated


Published in: API, DevelopmentPosted by Tyler on 01/30/07


I bet you all thought Snipplr was left for dead, eh? Sorry about that. In the last couple months I’ve gotten married, bought a house, and helped roll out a new service. Things have been busy :)

Back to business. I’ve updated the API’s snippet.post method to allow specifying a language type. To do so, pass an (optional) fourth parameter containing the language ID. What is the language ID you may ask? It’s the URL formatted language name found in all of Snipplr’s URLs. For example:

http://snipplr.com/all/language/javascript http://snipplr.com/all/language/c-plus-plus http://snipplr.com/all/language/c-sharp http://snipplr.com/all/language/cold-fusion

In these URLs, the language IDs are “javascript”, “c-plus-plus”, “c-sharp”, and “cold-fusion”, respectively.

If that’s not helpful enough, I’ve also added languages.list method which returns a list of language url names and their corresponding pretty names. i.e., c-sharp and C#, c-plus-plus and C++.

You can view the API reference here.

Let me know if you run into any issues.


Snipplr Search Integrated With Firefox 2.0


Published in: Development, News, Plugins, ScreencastsPosted by Tyler on 10/25/06


Yesterday, Mozilla released Firefox 2.0 and with it a slew of new features. One of them is autodiscovery of websites that support Amazon’s OpenSearch format. Amazon describes OpenSearch as “a set of simple formats for the sharing of search results.”

What this means to you is Snipplr (and other websites with searchable content) can be searched directly from Firefox’s search box. There’s no need to first go to Snipplr and then do a search. Now you can search from inside your browser no matter what site you’re currently on. Here’s how it works.

Using Firefox 2.0, go to Snipplr.com – you’ll see the small arrow next to Firefox’s search box light up.

Firefox Search Box

Click on the arrow and choose “Add Snipplr” to add it to your list of search engines.

Firefox Search Engines

Now, you can search Snipplr using Firefox just like you do Google. Snipplr will even suggest searches as you type them! Here’s a short screencast showing the whole process in action.


TextMate Bundle Updated


Published in: Development, News, PluginsPosted by Tyler on 10/05/06


I’ve updated the Snipplr TextMate bundle to fix a small bug. Now it’ll give you a nice error message if you search for snippets and don’t find any. Thanks to Brian for pointing this out.


Snipplr Redesign – Things to Come


Published in: Design, Development, NewsPosted by Tyler on 10/03/06


As some of you know, Snipplr was bought by Sitening last month. It’s a great oppurtunity to help Snipplr continue to grow and even let me get paid for it :-) One of the first improvements coming to the site is a new design. Here’s a quick preview:

Snipplr Design Preview


Updated Snipplr API


Published in: API, Development, NewsPosted by Tyler on 09/20/06


Based on visitor feedback (thanks, Hernán!) I updated the Snipplr API this morning. The snippet.get method now returns a list of the snippet’s tags. Also, I added a much needed snippet.delete method that (you guessed it) lets you delete snippets from your account. Click here for the API documentation.


Download Your Snippets as a Zip File


Published in: Development, NewsPosted by Tyler on 09/11/06


I can’t count the number of times on this blog I’ve mentioned the importance of keeping websites like Snipplr open. I don’t mean online and in business, I mean keeping the data (your data) freely available for you to import and export as you see fit. That’s the point of the Snipplr API – to let you manage your snippets without ever having to even visit Snipplr.com. Today I’m releasing a new feature to continue this trend.

Many users have asked for a way to backup all their snippets. Just in case Snipplr goes offline or you want to move your code to another site. Ask an ye shall receive.

On your settings page you’ll find a new link that will let you download a zip file containing all of your snippets.

zipbackup


Thanks, Starbucks!


Published in: CommentaryPosted by Tyler on 08/21/06


Delicious Monster, the company behind the fantastic Delicious Library app for Mac, has made it a point to thank the coffee shop that they work out of. With good coffee, big desks, and friendly employees who needs an office? It sure saves on rent. Following in their lead, I think it’s high time to thank the Starbuck’s I spend a lot of my time in. I’d wager that 60% of Snipplr was born right here in this store.

What Starbucks am I speaking of? Why the one on Harding Road here in West End Nashville. The desks may not be very big, but there are plenty of outlets and above all a friendly staff that always makes me feel welcome no matter how long I stay.

Harding Road Starbucks

(Photo courtesey of Starbucks Everywhere)