That code looks familiar :p

For the first point, at the moment I just open another socket after the first is complete. If you want, you can try adding a Connection: Keep-Alive header and keeping track of how many bytes you receive (to know when to send the next request and close the socket).

For the second point, the $json alias handles reading the file. Just supply the file name, don't use $read.

I have some code that retrieves a full list of followers, getting subscribers would be done the same way: https://gist.github.com/memnochxx/5676bef5707a8019f0ca