From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/65385 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Downloading long urls Date: Fri, 21 Jan 2011 12:15:33 -0500 (EST) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1295630151 31594 80.91.229.12 (21 Jan 2011 17:15:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 21 Jan 2011 17:15:51 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Jan 21 18:15:47 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PgKaP-0000rP-VJ for gctc-ntg-context-518@m.gmane.org; Fri, 21 Jan 2011 18:15:46 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DA5C5CAA30; Fri, 21 Jan 2011 18:15:44 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cVVz7GK7Gx7j; Fri, 21 Jan 2011 18:15:42 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F2D9BCA9E3; Fri, 21 Jan 2011 18:15:41 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 24728CA9E3 for ; Fri, 21 Jan 2011 18:15:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wcvgJF99hu2o for ; Fri, 21 Jan 2011 18:15:38 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id CBF35CA978 for ; Fri, 21 Jan 2011 18:15:38 +0100 (CET) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p0LHFaC1004689 for ; Fri, 21 Jan 2011 18:15:38 +0100 Original-Received: FROM adi-netbook (Unknown [65.94.14.230]) By tombraider.mr.itd.umich.edu ID 4D39BF36.CD5A7.24565 ; Authuser adityam; 21 Jan 2011 12:15:35 EST In-Reply-To: User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.12.86; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08DWhfA0T - ca8a3b697421 - 20110121 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:65385 Archived-At: On Sun, 16 Jan 2011, Aditya Mahajan wrote: > Is there a robust way to avoid this problem? One possibility is that in > data-sch.lua instead of > > local cleanname = gsub(original,"[^%a%d%.]+","-") > > use local cleanname = md5.HEX(original) -- gsub(original,"[^%a%d%.]+","-") appears to work correctly in my tests. The drawback of this scheme is that instead of \externalfigure[url ending with .png] one would have to use \externalfigure[url ending with .png][method=png] But \input 'url ending with .tex' still works The other drawback is the filenames in the cache will be gibberish. But on the plus side, you can use long urls. Do you think that the drawbacks outweigh the gains? I need this for the webfilter module, where the url can get pretty long. I can always write my own http_get function, but that will be mostly repetition of data-sch.lua Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________