logo       

Re: Building the equivalent of wget in Squeak: msg#00194

lang.smalltalk.squeak.beginners

Subject: Re: Building the equivalent of wget in Squeak


Hi Andy,

I would like to create a simple means of getting the contents of a web page, in the same way that wget works. What I hoped to do was something like:

wget url: 'http://...' show.

I found a few classes e.g. Httpurl and also the asUrl method of the string class, but I can't quite work out how to put it all together. As it seems like a simple way to start learning Squeak, I wonder if someone could point me in the right direction.

You can use something like

(HTTPClient httpGet: 'www.google.com') contents

to get the text of a web page. Just using

HTTPClient httpGet: 'www.google.com'

gives you a "stream" over the page's text.

You can browse HTTPClient's class side to see how the method works and start digging deeper.

Hope this helps,
Benjamin Schroeder


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise