Building the equivalent of wget in Squeak

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Building the equivalent of wget in Squeak

Andy Burnett

Hello

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.

Thanks
AB
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Building the equivalent of wget in Squeak

Damien Cassou-3
[hidden email] wrote:

>
> Hello
>
> 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.

I can't help you, but Networking might not be the simplest thing to
start with :-)
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Building the equivalent of wget in Squeak

stéphane ducasse-2
In reply to this post by Andy Burnett
you can have a look at the chapter on networking on the blue book  
available on my web page:
        http://www.listic.univ-savoie.fr/~ducasse/FreeBooks.html

        DRAFTS of Squeak, Open Personal Computing and Multimedia Mirror of  
http://coweb.cc.gatech.edu/squeakbook/. Edited by Mark Guzdial and  
Kim Rose. Prentice-Hall 2000. It's available from Prentice-Hall.

Stef

On 21 août 06, at 20:42, [hidden email] wrote:

>
> Hello
>
> 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.
>
> Thanks
> AB
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Building the equivalent of wget in Squeak

Benjamin Schroeder-2
In reply to this post by Andy Burnett

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

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Building the equivalent of wget in Squeak

Andy Burnett
In reply to this post by Andy Burnett

Brilliant, that is just what I was looking for. I just hadn't been looking in the right places.

Thanks very much.

<<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>>

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners