Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default LWP and gzip

    New to perl and experimenting with LWP.

    However I have come across some website content that comes down as
    "content-encoding: gzip" followed by a few hundred bytes of
    gobbledegook.

    Can someone point me to some sample code to de-crypt this on the fly,
    please

    Thanks
    sprint@pilot.net Guest

  2. Similar Questions and Discussions

    1. gzip to max 9
      Dear All, <?php function wrl2wrz($buffer) { return gzencode ($buffer, 9); } ob_start("wrl2wrz"); /* here the file */ ob_end_flush(); #...
    2. tar and gzip
      In article <x7wuesu88v.fsf@bolo.xenadyne.com>, Sean Burke <burke_sp31415@pacbell.net> wrote: GNU tar does not create standard compliant TAR...
    3. Piping through gzip
      bill wrote: Compress::Zlib from www.cpan.org does this, i think kevin
    4. Where is gzip?
      I downloaded the 4330-09 to 4330-11 Maintenance pagkage, but it's a ziped tarball. My 433 system doesn't hagve gzip installed. Does anyone know...
    5. apt-get update: gzip: stdin: not in gzip format
      On Sat, Jul 05, 2003 at 11:01:02PM -0400, Robert August Vincent II wrote: Use FTP for your apt sources? -- "How can I not love the Americans?...
  3. #2

    Default Re: LWP and gzip

    On Mon, 08 Sep 2003 08:50:13 +0100, [email]sprint@pilot.net[/email] <sprint@pilot.net> wrote:
    > New to perl and experimenting with LWP.
    >
    > However I have come across some website content that comes down as
    > "content-encoding: gzip" followed by a few hundred bytes of
    > gobbledegook.
    >
    > Can someone point me to some sample code to de-crypt this on the fly,
    > please
    I'd guess that the uncompress function in Compress::Zlib might do the trick.

    However, it seems a bit "rude" for a web server to send gzip encoded
    stuff unless you specified it in the Accept-Encoding header of the request.

    --
    Sam Holden

    Sam Holden Guest

  4. #3

    Default Re: LWP and gzip

    <sprint@pilot.net> wrote in message
    news:rvcolvootvpdunblk55jpgc28qbivb54s7@4ax.com...
    > New to perl and experimenting with LWP.
    >
    > However I have come across some website content that comes down as
    > "content-encoding: gzip" followed by a few hundred bytes of
    > gobbledegook.
    >
    > Can someone point me to some sample code to de-crypt this on the fly,
    > please
    >
    > Thanks
    You are proabably downloading a file stored in zip format on the server.
    Archive::zip (available from [url]www.cpan.org[/url]) works with plain zip files.

    On Linux I would call the Linux utilities "gunzip" or "zcat", using the Perl
    "system" command, to unzip the file.

    gtoomey


    Gregory Toomey Guest

  5. #4

    Default Re: LWP and gzip

    [email]sprint@pilot.net[/email] wrote:
    > However I have come across some website content that comes down as
    > "content-encoding: gzip" followed by a few hundred bytes of
    > gobbledegook.
    The webserver shouldn't provide content with gzip encoding unless your
    client has offered that capability. Complain to the website provider.
    > Can someone point me to some sample code to de-crypt this on the fly,
    > please
    Feed the data content through one of the many gzip modules
    (e.g. Compress:Zlib or maybe PerlIO::gzip) to uncompress it.

    Chris
    --
    @s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
    until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
    news@roaima.freeserve.co.uk Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139