Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
How can I store the initial text/event-stream response from a get request in JavaScript when the server never stops loading?

I'm trying to retrieve some simple values from an API. This is the request URL:

https://pool.rplant.xyz/api2/poolminer2x/raptoreum/RThRfoQJg8qsoStLk7QdThQGmpbFUCtvnk/UlRoUmZvUUpnOHFzb1N0TGs3UWRUaFFHbXBiRlVDdHZua3x4

It seems that somehow the server puts the page in a constant refresh state. Whether in the browser or via my code, loading never completes, but I can see the JSON response in the browser. After about a minute, another JSON response is appended to the original in the browser.

This is the code snippet I'm currently using, and it doesn't seem to ever terminate although I've only waited a max of amount 5 minutes.

var response = UrlFetchApp.fetch("https://pool.rplant.xyz/api2/poolminer2x/raptoreum/RThRfoQJg8qsoStLk7QdThQGmpbFUCtvnk/UlRoUmZvUUpnOHFzb1N0TGs3UWRUaFFHbXBiRlVDdHZua3x4")
var json = JSON.parse(response.getContentText())

Is there a way for me to terminate the never-ending loop and retrieve what I already have as a response?

Edit:

As @JeremyThille pointed out, the response type is text/event-stream but am still unsure of who to handle this type of response.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Looks like the proper way to handle text/event-stream responses is usually with EventSource however, I am unable to use external libraries for my use case in Google Sheets.

var source = new EventSource('https://pool.rplant.xyz/api2/poolminer2x/raptoreum/RThRfoQJg8qsoStLk7QdThQGmpbFUCtvnk/UlRoUmZvUUpnOHFzb1N0TGs3UWRUaFFHbXBiRlVDdHZua3x4');
source.addEventListener('message', function(e) {
  console.log(e.data);
}, false);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!