Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #8575

Re: Read url into a string?

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Gene Wirchenko <genew@ocis.net>
Newsgroups comp.lang.javascript
Subject Re: Read url into a string?
Date Wed, 23 Nov 2011 15:00:20 -0800
Organization A noiseless patient Spider
Lines 28
Message-ID <pmuqc7t8p6ees0qo6sh484mc2o7jvv4afj@4ax.com> (permalink)
References <a0faab1d-920c-4d58-bb9f-b382b0b4ce38@w3g2000vbw.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Injection-Info mx04.eternal-september.org; posting-host="JCn9+dUdCQH+ycRezr2Sxw"; logging-data="12113"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yS1Yxx6Mr2CMQDeLVYdyC5CjZwUglBMQ="
X-Newsreader Forte Agent 4.2/32.1118
Cancel-Lock sha1:tQGqU/9r2BpwV7kIrxPPrV3whms=
Xref x330-a1.tempe.blueboxinc.net comp.lang.javascript:8575

Show key headers only | View raw


On Wed, 23 Nov 2011 14:09:10 -0800 (PST), SpreadTooThin
<bjobrien62@gmail.com> wrote:

>I want to open a url and read it into a string.
>That string will be passed onto a json parser.
>I tried this.. but it's doing nothing...
>
>import java.net;
>import java.io.*;
>
>function getURL(url) {
>   URL hp = new URL(url);
>   URLConnection yc = hp.openConnection();
>   BufferedReader in = new BufferedReader(new
>InputStreamReader(yc.getInputStream()));
>   String inputLine;
>   while ((inputLine = in.readLine()) != null)
>   {
>      alert(inputLine);
>      in.close();
>   }
>}

     JavaScript is not Java.  Try posting to a Java newsgroup.

Sincerely,

Gene Wirchenko

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Read url into a string? SpreadTooThin <bjobrien62@gmail.com> - 2011-11-23 14:09 -0800
  Re: Read url into a string? Gene Wirchenko <genew@ocis.net> - 2011-11-23 15:00 -0800
    Re: Read url into a string? SpreadTooThin <bjobrien62@gmail.com> - 2011-11-23 15:28 -0800
    Re: Read url into a string? Zlatko Đurić <zladuric@gmail.com> - 2011-11-24 00:29 +0100
      Re: Read url into a string? SpreadTooThin <bjobrien62@gmail.com> - 2011-11-23 15:34 -0800
      Re: Read url into a string? SpreadTooThin <bjobrien62@gmail.com> - 2011-11-23 15:37 -0800
      Re: Read url into a string? SpreadTooThin <bjobrien62@gmail.com> - 2011-11-23 16:35 -0800
        Re: Read url into a string? Scott Sauyet <scott.sauyet@gmail.com> - 2011-11-23 18:02 -0800
      Re: Read url into a string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-24 21:27 +0100
        Re: Read url into a string? Zlatko Đurić <zladuric@gmail.com> - 2011-11-24 22:13 +0100
          Re: Read url into a string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-24 22:31 +0100
            Re: Read url into a string? Zlatko Đurić <zladuric@gmail.com> - 2011-11-24 23:08 +0100
      Re: Read url into a string? Arno Welzel <usenet@arnowelzel.de> - 2011-11-25 15:59 +0100
  Re: Read url into a string? "Evertjan." <test@abc.invalid> - 2011-11-26 13:44 -0400

csiph-web