[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: wget --spider
From:       Sergey Ponomarev <stokito () gmail ! com>
Date:       2021-09-30 16:16:51
Message-ID: CADR0UcUJCXeA9eaUrXP-7vW_m4fjr5frzyna_0Qh+QjukqzkOw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


The gnu wget in spider mode shows "Length: 122 [text/html]" even without
-S. Actually the -S just shows headers.

BTW for a less code and more clearness instead of the spider option wget
may just send a HEAD request with --method=HEAD. In conjunction with recent
patch with -post-data this will allow to use wget to call any REST API


On Thu, Sep 30, 2021 at 18:38 Doug Clapp <doug.clapp@triad.rr.com> wrote:

> I think what you get may depend on what version of BusyBox you are
> using. I check 3 different versions I happen to have. v1.24.0.git shows
> only "-s|--spider" and seems to give no output except its return code.
> v1.27.2 shows "--spider" as well as "-S|--server-response."
>
> Using v1.27.2,
> busybox wget -S --spider http://example.com/ 2>&1 | busybox awk
> '/Content-Length/{print $2}'
> yields 1256, which is what I think you want. I've never used sed that
> much but awk is a tool I use a lot; that's why I rewrote the one-liner
> that way. You may have to get a newer version of BusyBox.
>
> Doug Clapp
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
-- 
Sergey Ponomarev <https://linkedin.com/in/stokito>, skype:stokito

[Attachment #5 (text/html)]

<div dir="auto">The gnu wget in spider mode shows &quot;Length: 122 [text/html]&quot; \
even without -S. Actually the -S just shows headers.<br><br>BTW for a less code and \
more clearness instead of the spider option wget may just send a HEAD request with \
--method=HEAD. In conjunction with recent patch with -post-data this will allow to \
use wget to call any REST API<br><br></div><div><br><div class="gmail_quote"><div \
dir="ltr" class="gmail_attr">On Thu, Sep 30, 2021 at 18:38 Doug Clapp &lt;<a \
href="mailto:doug.clapp@triad.rr.com">doug.clapp@triad.rr.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">I think what you get may depend on \
what version of BusyBox you are <br> using. I check 3 different versions I happen to \
have. v1.24.0.git shows <br> only &quot;-s|--spider&quot; and seems to give no output \
except its return code. <br> v1.27.2 shows &quot;--spider&quot; as well as \
&quot;-S|--server-response.&quot;<br> <br>
Using v1.27.2,<br>
busybox wget -S --spider <a href="http://example.com/" rel="noreferrer" \
target="_blank">http://example.com/</a> 2&gt;&amp;1 | busybox awk <br> \
&#39;/Content-Length/{print $2}&#39;<br> yields 1256, which is what I think you want. \
I&#39;ve never used sed that <br> much but awk is a tool I use a lot; that&#39;s why \
I rewrote the one-liner <br> that way. You may have to get a newer version of \
BusyBox.<br> <br>
Doug Clapp<br>
<br>
_______________________________________________<br>
busybox mailing list<br>
<a href="mailto:busybox@busybox.net" target="_blank">busybox@busybox.net</a><br>
<a href="http://lists.busybox.net/mailman/listinfo/busybox" rel="noreferrer" \
target="_blank">http://lists.busybox.net/mailman/listinfo/busybox</a><br> \
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" \
data-smartmail="gmail_signature"><div dir="ltr"><div><a \
href="https://linkedin.com/in/stokito" target="_blank">Sergey  Ponomarev</a>,  <font \
face="arial, helvetica, sans-serif"><a>skype:stokito</a></font><br></div></div></div>



_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic