Quote:
Originally Posted by natkejs
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
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
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.