Using open-uri or net/http to download a file from web?
-
Hi all!
Can I use open-uri or net/http to download a file from web in SU? -
Re-posting the lost post...
One possibility is to use the built-in SKSocket class in SketchUp. The following snippet might be useful:
def listener(s) $str << s if s == "Connection established" SKSocket.write "GET /RubyLibraryDepot/Ruby/weld.rb HTTP/1.0\r\n\n" end if s == "Connection closed" puts "Done" # Do something useful with the data end end $str = [] if Sketchup.is_online SKSocket.connect "www.crai.archi.fr", 80 SKSocket.add_socket_listener {|e| listener(e)} end
-
Could this be used to enforce/update a corporate SketchUp standard installation, I wonder?
Advertisement