From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Catonano Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] add web/mime support Date: Thu, 23 Feb 2012 16:03:33 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0022158c0d419d535104b9a2f213 X-Trace: dough.gmane.org 1330009445 32698 80.91.229.3 (23 Feb 2012 15:04:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Feb 2012 15:04:05 +0000 (UTC) Cc: guile-devel To: Nala Ginrut Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Feb 23 16:04:02 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S0aD5-0000F5-BP for guile-devel@m.gmane.org; Thu, 23 Feb 2012 16:03:55 +0100 Original-Received: from localhost ([::1]:41465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0aD4-00028U-JZ for guile-devel@m.gmane.org; Thu, 23 Feb 2012 10:03:54 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:51110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0aCw-00028J-8w for guile-devel@gnu.org; Thu, 23 Feb 2012 10:03:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0aCk-0002az-Nl for guile-devel@gnu.org; Thu, 23 Feb 2012 10:03:46 -0500 Original-Received: from mail-qw0-f41.google.com ([209.85.216.41]:50143) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0aCk-0002ap-LY for guile-devel@gnu.org; Thu, 23 Feb 2012 10:03:34 -0500 Original-Received: by qadz32 with SMTP id z32so7650629qad.0 for ; Thu, 23 Feb 2012 07:03:33 -0800 (PST) Received-SPF: pass (google.com: domain of catonano@gmail.com designates 10.229.137.21 as permitted sender) client-ip=10.229.137.21; Authentication-Results: mr.google.com; spf=pass (google.com: domain of catonano@gmail.com designates 10.229.137.21 as permitted sender) smtp.mail=catonano@gmail.com; dkim=pass header.i=catonano@gmail.com Original-Received: from mr.google.com ([10.229.137.21]) by 10.229.137.21 with SMTP id u21mr1260880qct.115.1330009413890 (num_hops = 1); Thu, 23 Feb 2012 07:03:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Ish81udovRwyTJTET9tZrum7GGhK8k1TSONOzGtNaE4=; b=lAMZBBLr5Ru75Y0vCi0xlFvuB7P/fnX3F8NLbCjFMT8OekDC8pxctjB7hJUT+rhcdk bEPvETMCuyKo8g26YwLeRdjgsC6eHE3eHmjBicfTyONMEoswYXzB2Bxtb+6cvDmLpAZp opJHLgUR7Xr4HU+xzmJB4d6H3rPOQfFAE6gNI= Original-Received: by 10.229.137.21 with SMTP id u21mr1077096qct.115.1330009413079; Thu, 23 Feb 2012 07:03:33 -0800 (PST) Original-Received: by 10.229.124.143 with HTTP; Thu, 23 Feb 2012 07:03:33 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.216.41 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13934 Archived-At: --0022158c0d419d535104b9a2f213 Content-Type: text/plain; charset=ISO-8859-1 Il giorno 23 febbraio 2012 15:53, Nala Ginrut ha scritto: > There's no mime support in Guile module, so I modified the mime code of my > project Ragnarok and format a patch. > It's easy to use: > (use-modules (web mime)) > (define mime (make )) > (mime:guess mime 'pdf) > ==> application/pdf > (mime:guess mime 'php) > ==> application/x-httpd-php > > Maybe useful for some guys~ > Any comments? > just recently I happened to download something and the mimetype was not textual even though the content was textual indeed (it was a .ram link hat is a url starting with rtsp://...) So what I got back was a bytevector and I had to decode it in my code; a ugly hack Personally I'd be interested in see how your stuff could be used together with http-get to download something with a weird mimetype Thanks --0022158c0d419d535104b9a2f213 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Il giorno 23 febbraio 2012 15:53, Nala G= inrut <nalagin= rut@gmail.com> ha scritto:
There's no mime support in Guile module, so I modified the mime code of= my project Ragnarok and format a patch.
It's easy to use:
(use-modules (web mime))
(define mime (make <mime>))
(mime:guess mime 'pdf)
=3D=3D> application/pdf
<= div>(mime:guess mime 'php)
=3D=3D>=A0application/x-httpd-p= hp

Maybe useful for some guys~
Any comme= nts?

just recently I happened to download something and th= e mimetype was not textual even though the content was textual indeed (it w= as a .ram link hat is a url starting with rtsp://...)

So what I got= back was a bytevector and I had to decode it in my code; a ugly hack

Personally I'd be interested in see how your stuff could be used to= gether with http-get to download something with a weird mimetype
=A0
Thanks
--0022158c0d419d535104b9a2f213--