FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

How to display the screen image from the Internet?

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
Phosee
Newbie


Joined: 18 Aug 2008
Posts: 4
Location: Kiev, Ukraine

PostPosted: Fri Aug 13, 2010 12:22 am    Post subject: How to display the screen image from the Internet? Reply with quote

Need your help. It is easy to display picture, witch is on PC:
theScreen.image = "C:\\image\\img.jpg";

but how to display the image from the Internet?
This: theScreen.image = "http:\\site.com\\image\\img.jpg"; does not work.
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Fri Aug 13, 2010 10:41 am    Post subject: Reply with quote

AFAIK you have to save it locally first.

Should be similiar to:[quote]
var http = new ActiveXObject("Msxml2.XMLHTTP");
http.open("GET", "http://my.url.html", false);
http.send(null);
var source = http.responseText;[/quote]

http://msdn.microsoft.com/en-us/library/7sw4ddf8%28VS.85%29.aspx
Back to top
View user's profile Send private message
Phosee
Newbie


Joined: 18 Aug 2008
Posts: 4
Location: Kiev, Ukraine

PostPosted: Fri Aug 13, 2010 2:14 pm    Post subject: Reply with quote

I tried this code in this way:
[code:1]
var http = new ActiveXObject("Msxml2.XMLHTTP");
http.open("GET", "http://video.nash.net.ua/?film=17626", true);
http.send(null);
var source = http.responseText;

var fso = new ActiveXObject( "Scripting.FileSystemObject" );
settingsFileStream = fso.CreateTextFile( "D:\\settings.txt", true );
settingsFileStream.Write( source );
settingsFileStream.Close();
[/code:1]
it saves plain htm-code of page (attached)
but when I tried:
[code:1]http.open("GET", "http://video.nash.net.ua/posters/17626.jpg", true);
........
settingsFileStream = fso.CreateTextFile( "D:\\img.jpg", true );
[/code:1] nothing happens :(



settings.txt
 Description:

Download
 Filename:  settings.txt
 Filesize:  19.44 KB
 Downloaded:  4658 Time(s)

Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Sat Aug 14, 2010 11:22 am    Post subject: Reply with quote

Here's a very crude but working script..

[quote]
var file = _getImage("http://www.salling.com/forums/images/avatars/gallery/phone%20models/t610_5.jpg");

launchWidget();

function _getImage(query) {
var file = resourcesPath + "\\img.jpg";

var xml = new ActiveXObject("Msxml2.XMLHTTP");
xml.open("GET", query, false);
xml.send(null);

var oStream = new ActiveXObject("ADODB.Stream");
oStream.Type = 1;
oStream.Open();
oStream.Write(xml.responseBody);
oStream.SaveToFile(file);
oStream.Close();
return file;
}

function launchWidget()
{
var widget = CreateKeypadScreen( "mykeypad_" );
widget.title = "ViewImage";
widget.name = "ViewImage";
widget.image = resourcesPath + "\\img.jpg";
theTerminal.Push( widget );
}

function mykeypad_Update( theScreen )
{
try {
//...
} catch( e ) {}
}
[/quote]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group