Hi folks, I am the leader of a dutch pokemon community. A member of our community has set up a Pokemon online server. I want to call a HTTP-page (ajax red, url is fine) when a user connects the server. With those scripts, we will be able to show the online users on our website. The question is, how can I call a webpage uri with qtscript (the result don't have to be parsed or read). So I want to do something like this: * Server starts * User connects * -> Server calls http://mysite.nl/userconnected.php?username=Pietje * User disconnects * -> Server calls http://mysite.nl/userdisconnected.php?username=Pietje How can I arrange this with qtscript? (the external webpage call) I've noticed that XMLHttpRequest() does not work. Thx in advance! Edit, it seems that qurl and qdownloader can't be used. Importer.loadQtBinding( "qt.core" ); Importer.loadQtBinding( "qt.xml" ); both fail.
Hi Try using sys.system("firefox http://mysite.nl/userconnected.php?username=Pietje").... Or call a bat file you made, using sys.system().
No, it's fine when the server calls the AJAX. Using sys() is a very dangerous thing, it can be exploited and then the system can be hacked in any way. I personally think it's not a useless function, it can be used for many many purposes. Is it ok if I write a patch for it? I'll hand it in to you, so you can apply this patch on your server software?
Of course it's ok and i'll be glad. And using sys.system() is dangerous only if people have direct access to the scripts, but you know your server better than me.
Webcall patch I wrote the webCall function. The patch is uploaded @SourceForge (https://sourceforge.net/tracker/?func=detail&aid=3009854&group_id=266365&atid=1133861). It supports non-encrypted non-authorized http-calls * GET * POST Code (text): webCall( String uri, String expr, [ Array post [ key=>value ] ]. expr will be evaluated when the http request is handled (the server will not block!) In expr one should use resp to get the response. Example 1: Code (text): sys.webCall('http://www.mysite.com/getwelcomemsgtxt', 'print( resp )'); It will download a welcome messaged from http://www.mysite.com/getwelcomemsg.txt and print it on screen. Example 2: Code (text): var x = Array(); x['uname'] = 'Pietje'; x['foo'] = 'bar'; sys.webCall('http://www.mysite.com/usergoesonline', 'myfunc( resp )', x); This will send x to the uri as a HTML-form result. When the response is returned, a function myfunc will be called with the server response.