Hxssl and sys.io.Process

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Hxssl and sys.io.Process

This post has NOT been accepted by the mailing list yet.

I am trying to build a small neko app to load a number of images for further processing from instagram. I got the needed access token and can make calls to the api from Instagram.
Since int only allows me to use https requests, I went for the hxsll lib. I am able to make teh request and fetch the answer. The answer is a json string which always fails with parsing errors. The string is rather large and I found some incorrect chars in the string. To me it looks like that hxssl is adding the size of the received chunks right in the result. I used the code from the example provided by hxssl.
The output with error looks like this:
5a8 <--------- ????
ted_time":"1335003466","text":"ADD meee","from":{"username":"romain59111","profile_picture":"http:\/\/images.instagram.com\/profiles\/profile_21787695_75sq_1334325173.jpg","id":"21

After that I tryed using a system call to wget and curl. I was able to call curl, but not via sys.io.process. It never ruturned an result. The call to wget always throws an error.[Command not found : wget]
commandOutput('wget', ['-q', '-P', Sys.getCwd() + 'assets/', imgurl]);
function commandOutput( cmd , argu) {
   var p = new sys.io.Process(cmd,argu);//try new sys.io.Process(cmd,[]) catch( e : Dynamic ) trace(e); return "";
   return p.stderr.readAll().toString() + p.stdout.readAll().toString();

How do I call wget the right way?
Is it a bug in hxssl?