Re: Wxeuphoria network functionality

new topic     » goto parent     » topic index » view thread      » older message » newer message

Matt Lewis wrote:
> 
> Jason Gade wrote:
> > 
> > Matt,
> > 
> > Are the wxeuporia routines for downloading files work yet?
> > 
> > Could I use wxeuphoria to download an internet file or should I stick with
> > calling
> > wget for now?
> > 
> 
> I've had success with them.  I was downloading the Euforum text file and 
> converting it into an rss file.  Here is the routine I used to get the file:
> }}}
<eucode>
> procedure on_timer( atom this, atom event_type, atom id, atom event )
> 	atom url, stream
> 	integer fn
> 	sequence path, current
> 	path = get_text_value( file_name )
> 	fn = open( path, "w" )
> 	if fn = -1 then
> 		-- error opening the file, should post an error message to the user
> 		return
> 	end if
> 	url = create( wxURL, "http://www.listfilter.com/mlist/current.txt" )
> 	stream = get_url_input( url )
> 	if stream then
> 		current = stream_read( stream )
> 		puts( fn, "<?xml version='1.0' encoding='utf-8' ?>\n" )
> 		puts( fn, "<rss version=\"2.0\">\n" )
> 		puts( fn, "<channel>\n")
> 		puts( fn, "<title>EuForum</title>\n" )
> 		puts( fn, "<link>http://www.listfilter.com/EuForum</link>\n" )
> 		puts( fn, "<description>EuForum RSS Feed - Official Euphoria Message
> Board</description>\n" )
> 		
> 		to_rss( fn, current )
> 		
> 		puts( fn, "</channel>\n</rss>\n" )
> 		delete_instance( stream )
> 	else 
> 		puts(2, "Stream failed!\n")
> 	end if
> 	delete_instance( url )
> 	close(fn)
> end procedure
> </eucode>
{{{

> 
> Matt Lewis

Thanks, Matt.

I don't think I've looked at the latest release of wxeuphoria, but I remember
looking in your documentation and it saying that it wasn't working correctly. At
least that is the way I understood it.

This example helps and now I have one less excuse for getting started!

--
"The author regrets that he is unable to reconcile himself to the
thoughtful point of view you have expressed. However, it must be kept
in mind that being raised in different cultures and different places can
result in such differences of viewpoint between individuals.
The author is from planet Earth." [author unknown]

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu