View Single Post
Old 04-30-2024, 09:36 AM  
sarettah
l8r
 
Industry Role:
Join Date: Oct 2002
Posts: 13,578
Quote:
Originally Posted by natkejs View Post
Fetch her cam URL and check if she's online that way.
Cache the results for 2 minutes at a time or something like that.

Should be way more efficient than pulling their entire feed just to see if one individual model is online.
Quote:
Originally Posted by fris View Post
you could fetch the html of the model page and check for the status.

methods

1. regex
2. simplehtmldom
3. didom (which i like)
Quote:
Originally Posted by Darkhorse View Post
Something like this should work.

Code:
<?php
// Model URL to check
$url = "https://chaturbate.com/shinyways/";

// Create a new DOMDocument
$doc = new DOMDocument();

// Load the webpage content
@$doc->loadHTMLFile($url);

// Check if the model is online
$onlineElement = $doc->getElementById('room_subject');
if ($onlineElement !== null) {
    // Model is online
    echo "shinyways is online!";
} else {
    // Model is not online
    echo "shinyways is not online.";
}
?>
I don't think those will work as cleanly as you think. I could be wrong.

The curl option will definitely hit the the 18 and over warning page and you really can't interact with that through curl.

I believe the domdocument and the simplehtml method will hit the same thing. I can't accurately test right now because allow_url_fopen() is turned off on my server.

You could use a headless browser and negotiate with the page that way.

Thus, I think iterating through the results is a valid solution.
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote