E-Scribe News : a programmer’s blog

About Me

PBX I'm Paul Bissex, and e-scribe.com is my consulting business. I build web applications using open source software, especially Django. I teach photographers web design and professional skills. In the '90s I did graphic design for newspapers and magazines. Then I wrote technology commentary and reviews for Wired, Salon.com, Chicago Tribune, and lots of little places you've never heard of. Feel free to email me.

Book

Python Web Development with Django I'm co-author of "Python Web Development with Django", an excellent guide to my favorite web framework. Its strong points include an introduction to Python, and better coverage of Django 1.0 than nearly anybody else. Published by Addison-Wesley, it is available from Amazon and your favorite technical bookstore as well.

Colophon

Built using Django, served by Apache and mod_wsgi. The database is SQLite. The operating system is FreeBSD, on a VPS hosted at Johncompanies.com. Comment-spam protection by Akismet. Vintage topo imagery from the Maptech archive. The markup engine is Markdown.

Pile o'Tags

Stuff I Use

Akismet, del.icio.us, Django, dpaste.com, Emacs, FreeBSD, Freenode, jQuery, LaunchBar, MacPorts, Markdown, Mercurial, OS X, Postfix, Python, SQLite, Subversion, TextMate, Trac, Ubuntu Linux, wmii

Spam Report

At least 67591 pieces of comment spam killed since January 2008, mostly via Akismet.

A tiny little dpaste.com API

When I created dpaste, I tried to make it both a simple browser-based tool and a simple RESTful API. With very little work you could write a script that created a new paste item with a single POST.

Over the life of the site a few people have discovered and played with that "secret" API. I've now made it a bit more official. The new API has its own URL (versioned, even!) and is more tolerant of missing data, just like the web form.

The URL is http://dpaste.com/api/v1/. In a web browser you'll see just a terse line of instructions. Here's a one-line usage example for unixy people. It takes text on stdin and returns the URL of the newly created paste.

curl -si -F 'content=<-' http://dpaste.com/api/v1/ | grep ^Location: | colrm 1 10

Support disclaimer: Depending on your version of curl and your shell some of those options may need twiddling. But in a low-tech way it's kind of cool, isn't it? (Figuring out how to get curl to read stdin was a new one for me, so the novelty is high at the moment.)

Anyway, use and enjoy as you wish!

Sunday, November 30th, 2008
+ + +
5 comments

Comment from mikele , 8 weeks later

hey thanks for this!! btw how can I specify the syntax of the snippet???

Comment from Paul , 12 weeks later

mikele: Set the "language" field. Look at the source of the dpaste.com form to see the options.

Comment from sm4rt h4ck3r , 22 weeks later

dpaste is fantastic! Simply fantastic...
You did an Impressive work Paul, really!
1. Its secured than others.
2. It uses auto delete, so it is great for your server space.
3. It converts it all in normal text and gives a url, wow!
4. It is FREE!

My request: Can you please start something like "Tutorials" for python and/or perl.. Some websites do offer but they are just not so good..

PS: If you start tutorials, me and my team will be glad to learn and click on your ads too ;-)

Comment from Griffin , 8 months later

Love it, using it now for an IRC bot (hope you don't mind!). Thanks for the API <3

Comment from Paul , 8 months later

Excellent! That's exactly the sort of thing I wanted to enable. Thanks for using it.

Post a comment

Thanks for reading! Please note: Your comment will not appear until approved, which may take a few hours or more. Spammers will be torpedoed.


(Will not be shared)

(Optional)