From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: Howto: Retrieve only URL metadata Date: Tue, 26 Mar 2024 23:17:22 -0500 Message-ID: <52f4e345-b805-455b-9ec6-2907d3d1315a@alphapapa.net> References: <26115.36206.776145.115534@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28110"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org To: raman@google.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 27 05:18:26 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rpKk6-00075g-0f for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Mar 2024 05:18:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpKjD-0000xM-Gj; Wed, 27 Mar 2024 00:17:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpKjB-0000tG-NM for emacs-devel@gnu.org; Wed, 27 Mar 2024 00:17:29 -0400 Original-Received: from snail.cherry.relay.mailchannels.net ([23.83.223.170]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpKj9-0000eD-Pm for emacs-devel@gnu.org; Wed, 27 Mar 2024 00:17:29 -0400 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 234217613E7; Wed, 27 Mar 2024 04:17:24 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a230.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B6E6E76174F; Wed, 27 Mar 2024 04:17:23 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1711513043; a=rsa-sha256; cv=none; b=zhJkcF2Tey6ICRSi1wxpUJy+y6WC1gNcFhp5CBYIqVk+rpe1KEjDtiQ7O0NIj4clH/Nhl8 vFI/7a8d0qIypzPxgI4dUMHFrjOIJklPTFgCsviqd3bApmbVxTDhI7PFWQgEgCx2hUMSbl 078BZjV3IdwGqlSZ/O7RSw49LpuH4ESuzLOsk0TiRQwwtcbAe2cJLkCZgWVIH75XRc4aeU 69FcvjpJShojgl51AEeDb1KdyHnbbTTntXPFJdrih9D0hmT8TSorzkBU77De54BpQjs+t1 5W3kD+vMdmKAR7PjEIlVlBXIpAvTELB7Yu0QySkjW5UvTqB+jHHW3AhnLwkDjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1711513043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YW4Iu13zQk2nzsJSUOFDDYJAfyW0IFGMaHFhBJvkmPU=; b=uQVT83rxekbqm4TD9xWiHuG1TaL/QG92Rja/0pqrysHA2/qDoGBuHrx1D+tQgLw58grzpy 1alKsNzpyK0q58y1wR6zMWwhbcFJsuWNV6mSMC2dKjY4px3Ct1bIexxb54mxMKBU1aaEo6 5nQHsujHCiknDH1h+8mlUDl75layJu3VTyRC1qdNSUNNn57vTvlEhQ9ObhSkalb8Vw0kB+ A6jiKuLlV03+ZmDlk19LHYzeiFjU5yYjhH/muh+zo9kIHLCMuci11BA5ebmW8s9WM+FksK J5sMSzomujRveHO2suzGZ/UABdH/t3ykItN9GPL+ktZgxUq4WWzz/Aak9gg9Uw== ARC-Authentication-Results: i=1; rspamd-699949c56f-zbpdl; auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net X-MailChannels-Auth-Id: dreamhost X-Plucky-Name: 569547fb7bb4a295_1711513043990_2910928114 X-MC-Loop-Signature: 1711513043990:2055637052 X-MC-Ingress-Time: 1711513043989 Original-Received: from pdx1-sub0-mail-a230.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.123.121.28 (trex/6.9.2); Wed, 27 Mar 2024 04:17:23 +0000 Original-Received: from [10.28.0.206] (unknown [45.131.192.18]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: adam@alphapapa.net) by pdx1-sub0-mail-a230.dreamhost.com (Postfix) with ESMTPSA id 4V4D0M2Pksz4j; Tue, 26 Mar 2024 21:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1711513043; bh=YW4Iu13zQk2nzsJSUOFDDYJAfyW0IFGMaHFhBJvkmPU=; h=Date:To:Cc:Subject:From:Content-Type:Content-Transfer-Encoding; b=xFa393caJhdDIehRtbzfCurVi2E4imX+oQpw8VeLqCT1hOGY4hWZKUdFb+pnyitJI k+/Ifpd/2fo4G7z3zb5HMtL9DrnI48Bk4bH4yXH987dTPNE2e7TV4yqBAJ5z6ItujM MG5AKsSHh7PfDJN8NzLbD3WI13PQz2ux8Vyl70laEkP5vOuVeIdwc2W++pI8QuA6Yl voNaWIpBEqsvr+m6QKAyS5ExrYsncSpiLZIFs8NL6RtJ5MXblGx6RQL/XboR5es7u2 kXzZBpWiOuv7acuv/+a38Ma1MrftFdDvcHpC0iisOagQ4xFlKGpYoqYu052iHExQTI xJHsZQf8X8HmQ== Content-Language: en-US In-Reply-To: <26115.36206.776145.115534@google.com> Received-SPF: neutral client-ip=23.83.223.170; envelope-from=adam@alphapapa.net; helo=snail.cherry.relay.mailchannels.net X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317321 Archived-At: > Is there a light-weight means of just retrieving URL metadata given a > URL using the url package in Emacs? > > Note: I know how to do that using Curl and parsing the output from a > HEAD method call; am looking for a pure elisp solution FYI, if you'll forgive the transgression, since plz.el is in ELPA and "part of Emacs", here's a simple way to do it: (plz-response-headers (plz 'head "https://lists.gnu.org/archive/html/emacs-devel/2024-03/msg00670.html" :as 'response)) ;; ((date . "Wed, 27 Mar 2024 04:11:27 GMT") ;; (server . "Apache/2.4.29 (Trisquel_GNU/Linux)") ;; (strict-transport-security . "max-age=63072000; includeSubDomains; preload") ;; (x-frame-options . "sameorigin") ;; (x-content-type-options . "nosniff") ;; (last-modified . "Wed, 27 Mar 2024 03:44:54 GMT") ;; (etag . "\"1472-6149c3ac97980-gzip\"") ;; (accept-ranges . "bytes") ;; (vary . "Accept-Encoding") ;; (content-encoding . "gzip") ;; (content-length . "2022") ;; (content-type . "text/html")) A future version will probably simplify that, returning the alist of headers directly for calling: (plz 'head URL)