AE ENHANCERS

Expressions/Scripts/Presets
It is currently Wed May 22, 2013 1:29 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: New Socket Object
PostPosted: Sun May 20, 2012 2:49 pm 
Offline

Joined: Tue May 15, 2012 1:54 am
Posts: 7
Hi,
Here are some code to download a (source code ) web page with the socket object and save it on your desktop and open it.
hoping that it may be useful to someone.

//---
var reply = "";
var conn = new Socket;
// access Adobe’s home page
if (conn.open ("www.adobe.com:80")) {
// send a HTTP GET request
conn.write ("GET /index.html HTTP/1.0\n\n");
// and read the server’s reply
reply = conn.read(999999);
conn.close();
}

var file = new File("C:/Users/Michel/Desktop/adobe.htm"); // instead of "Michel" the user name of your computer.
file.encoding = "UTF8";
file.open("w", "TEXT", "????");
// unicode signature, this is UTF16 but will convert to UTF8 "EF BB BF"
file.write("\uFEFF");
file.lineFeed = "unix";
file.write(reply.toString());
file.close();
file.execute();
//----

Michel :mrgreen:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group