cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
New to using JMP? Hit the ground running with the Early User Edition of Discovery Summit. Register now, free of charge.
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
lala
Level VII

How can JSL automatically stop the download of data stream data as Python does?

Hello!

Data on this site will be updated every 3 seconds.Using the normal method, you will always be downloading without downloading data.
Python writes code like this to terminate the data download.
How to change this Python to JSL?

2022-07-08_07-17-44.png

This address is captured after the packet.

http://16.push2.eastmoney.com/api/qt/stock/details/sse?fields1=f1,f2,f3,f4&fields2=f51,f52,f53,f54,f55&mpi=2000&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&pos=-0&secid=1.688686

http://16.push2.eastmoney.com/api/qt/stock/details/sse?fields1=f1,f2,f3,f4&fields2=f51,f52,f53,f54,f... 

 

4 REPLIES 4
lala
Level VII

Re: How can JSL automatically stop the download of data stream data as Python does?

Just the data in front of the red box.
Null data is generated 3 seconds later.It's not necessary.

Thanks!

20220708163938.png

lala
Level VII

Re: How can JSL automatically stop the download of data stream data as Python does?

The code will remain in download until it crashes.

u =
"http://16.push2.eastmoney.com/api/qt/stock/details/sse?fields1=f1,f2,f3,f4&fields2=f51,f52,f53,f54,f55&mpi=2000&ut=bd1d9ddb04089700cf9c27f6f7426281&fltt=2&pos=-0&secid=1.688686";
txt = Load Text File( u );
a = Length( txt );
P = "[{";
off1 = Contains( txt, P );
If( off1,
	tx = Substr( txt, off1, Length( txt ) )
);
Q = "}]";
off2 = Contains( tx, Q, -1 );
If( off2,
	tx = Substr( tx, 1, off2 + 1 )
);
b = Right( tx, 2 );
d1 = JSON To Data Table( tx );
lala
Level VII

Re: How can JSL automatically stop the download of data stream data as Python does?

Open this way and press ESC repeatedly to get these results

2022-07-08_17-03-27.png

Craige_Hales
Super User

Re: How can JSL automatically stop the download of data stream data as Python does?

I think JSL sockets might work if you want to invest the time to learn about sockets and the http protocol. I think using curl from run program might also work, but I'm not sure how to terminate curl from run program.
Craige