Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
04-26-2024, 05:47 PM | #1 |
So Fucking Banned
Industry Role:
Join Date: Apr 2023
Posts: 83
|
Chaturbate API for online models.
Can someone explain to me what am I doing wrong.
Why does this curl returns me one entry but not the room of shinyways (who is online) but some other model? https://chaturbate.com/api/public/af...ways& limit=1 And this, return huge array of whole bunch of models and their details including shinyways, but she is hidden in the middle somewhere. https://chaturbate.com/api/public/af...name=shinyways What do I do just to check if username=shinyways is online.. That is all I'm trying to do. |
04-26-2024, 06:57 PM | #2 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 54,923
|
username is not a valid query arg, so when you are parsing the first result, its ignoring username and just giving you 1 result of the onlinecams.
the second one you have no limit, so she will show up somewhere in there.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. WP Tube Themes |
04-26-2024, 07:43 PM | #3 | |
So Fucking Banned
Industry Role:
Join Date: Apr 2023
Posts: 83
|
Quote:
So what is the most efficient way to check for individual model if she is online or not? Just look through entire feed of "models on line"? |
|
04-26-2024, 07:52 PM | #4 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 54,923
|
Quote:
you will want the seconds_online value in the array.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. WP Tube Themes |
|
04-26-2024, 09:06 PM | #5 |
I'll make you famous
Industry Role:
Join Date: Oct 2002
Posts: 13,941
|
You can limit it some more.
If the model has a particular tag (or tags) that they alwas use, you can pull for those tags. Only issue is if the model stops using those tags the query won't return them even if they are online. &tag=tag_name ex: &tag=petite&tag=lesbian also include the gender field &gender=f or &gender=m ...etc if you know what country is usually included in their record, include the region field. ®ion=northamerica Each additional parameter lowers the number of possibilities Each call to the api can get up to 500 records back So loop through, grab the first call using &limit=500, if you get less than 500 then you have all the records. If your model is not in the first group, check the count parameter and then loop through grabbing a new result using the &offset= and a limit of 500 until you either find the model or hit the end and say they ain't there Good luck. |
04-27-2024, 03:03 AM | #6 |
Confirmed User
Industry Role:
Join Date: Jan 2003
Location: Nomad Land
Posts: 1,571
|
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.
__________________
|
04-27-2024, 06:21 AM | #7 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 54,923
|
you could fetch the html of the model page and check for the status.
methods 1. regex 2. simplehtmldom 3. didom (which i like)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. WP Tube Themes |
04-27-2024, 08:13 AM | #8 | |
Horsing Around
Industry Role:
Join Date: Sep 2002
Location: AU
Posts: 5,846
|
Quote:
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."; } ?> |
|
04-30-2024, 09:36 AM | #9 | |||
I'll make you famous
Industry Role:
Join Date: Oct 2002
Posts: 13,941
|
Quote:
Quote:
Quote:
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. |
|||
04-30-2024, 10:07 AM | #10 | |
making it rain
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 21,853
|
Quote:
|
|
04-30-2024, 10:39 AM | #11 |
I'll make you famous
Industry Role:
Join Date: Oct 2002
Posts: 13,941
|
Another option, if you want to avoid the iteration solution would be to pull the version 1 api every couple of minutes and store it on the server
Then whenever you want to see if the model is online you just check inside the file to see if she is there, you can use a simple substr_count() to test if the model name is in there. The pull of the version 1 gets all models on line so you pull it via cron to load into your file, on my server it takes about 1 second to pull. |
04-30-2024, 07:21 PM | #12 | ||
Confirmed User
Industry Role:
Join Date: Jan 2003
Location: Nomad Land
Posts: 1,571
|
Quote:
Quote:
This is incorrect as they would have no idea whether the client has javascript enabled or not on the first request.
__________________
|
||
04-30-2024, 09:15 PM | #13 |
making it rain
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 21,853
|
|
05-01-2024, 05:49 PM | #14 |
I'll make you famous
Industry Role:
Join Date: Oct 2002
Posts: 13,941
|
I stand corrected also. I had done a quick curl pull and stopped looking through the page at the 18 year old stuff. It does appear that the actual page appears underneath. So a curl solution could probably work.
|