Accessing data

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing data

Sco66
Hi sc list,

I have a question about getting data from https.  I have searched the list a
bit and come up with a couple of solutions - one problem however eludes me.

this kind of request seems to work (code taken from an answer to a similar
question):

        "curl http://lhcsound.hep.ucl.ac.uk/jetdata2/JetGame_1000004.txt -o
~/Documents/SuperCollider1/SuperCollider_2018/Visualization/zz_2.txt".unixCmd{"open
~/Documents/SuperCollider1/SuperCollider_2018/Visualization/zz_2.txt".unixCmd}

this however has a .txt that is accessing...  Trying to get some information
in plain format from random.org this form doesn't work.  A solution given in
Mapping and Visualization book is this:

(
                var data = "curl
\"http://www.random.org/sequences/?min=1&max=100&col=1&format=plain&rnd=new\"".unixCmdGetStdOutLines;
        data.postln;
        )

However that doesn't seem to be working for me.  If someone could point me
in the right direction that would be great.

Many Thanks,

Scott.



--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|

Re: Accessing data

brianlheim
Hey Scott,

Try using wget with option -O- (output to stdout):

"wget -O- \"<a href="http://www.random.org/sequences/?min=1&amp;max=100&amp;col=1&amp;format=plain&amp;rnd=new\" rel="noreferrer" target="_blank">http://www.random.org/sequences/?min=1&max=100&col=1&format=plain&rnd=new\"".unixCmdGetStdOutLines;

-Brian

On Fri, Jan 12, 2018 at 9:17 PM, <[hidden email]> wrote:
Hi sc list,

I have a question about getting data from https.  I have searched the list a
bit and come up with a couple of solutions - one problem however eludes me.

this kind of request seems to work (code taken from an answer to a similar
question):

        "curl http://lhcsound.hep.ucl.ac.uk/jetdata2/JetGame_1000004.txt -o
~/Documents/SuperCollider1/SuperCollider_2018/Visualization/zz_2.txt".unixCmd{"open
~/Documents/SuperCollider1/SuperCollider_2018/Visualization/zz_2.txt".unixCmd}

this however has a .txt that is accessing...  Trying to get some information
in plain format from random.org this form doesn't work.  A solution given in
Mapping and Visualization book is this:

(
                var data = "curl
\"<a href="http://www.random.org/sequences/?min=1&amp;max=100&amp;col=1&amp;format=plain&amp;rnd=new\" rel="noreferrer" target="_blank">http://www.random.org/sequences/?min=1&max=100&col=1&format=plain&rnd=new\"".unixCmdGetStdOutLines;
        data.postln;
        )

However that doesn't seem to be working for me.  If someone could point me
in the right direction that would be great.

Many Thanks,

Scott.



--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Reply | Threaded
Open this post in threaded view
|

Re: Accessing data

Sco66
Reply | Threaded
Open this post in threaded view
|

Re: Accessing data

Sco66
Hi,

that wget solution:  do I need to re-format that url?  It doesn't seem to
work as provided.  Any other pointers...?



--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|

Re: Accessing data

brianlheim
Ah never mind, the problem is that curl isn't following the redirect to https. You can add the -L flag or change the url to https://.

-Brian

On Fri, Jan 12, 2018 at 9:50 PM, <[hidden email]> wrote:
Hi,

that wget solution:  do I need to re-format that url?  It doesn't seem to
work as provided.  Any other pointers...?