GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Tech Cams - Chaturbate API V2 parsing via JavaScript (https://gfy.com/showthread.php?t=1341908)

Paul&John 02-14-2021 09:34 AM

Quote:

Originally Posted by sarettah (Post 22821956)
My guess is that it would definitely be possible for a site just using the api to be as fast or faster than a site pulling the whole thing into the database.

First of all there are efficient ways to do things and inefficient ways. If someone has coded the api call and parse propely and is doing pagination then that could be a very fast site. However if they are doing just the api and trying to present all the cams all at once then it will probably be a slow load.

On the server side solution, the database has to be designed properly and the sql calls need to be coded properly. Just because something is in a database does not mean it is fast or efficient.

There is a lot of shitty code out there, I know because I have written some of it.

.

Yeah I'm definitely calling the API with limit+page and tags where needed (subcategory pages). It's pretty fast..

sarettah 02-14-2021 09:59 AM

Quote:

Originally Posted by Paul&John (Post 22821968)
Yeah I'm definitely calling the API with limit+page and tags where needed (subcategory pages). It's pretty fast..

You are talking about API V2 then?

I thought you were talking about V1. But with V2, yeah, definitely can make a site run faster then going into a database or caching scheme. Less infrastructure to deal with. Less steps involved.

I am going to set up dudefoxes using full client side javascript. Only call back to the server will be the click into the cams because I want to hit my tracking script (oh and the logo and crap like that).

.

Paul&John 02-14-2021 12:06 PM

No-no, I'm talking about AWEs Video Promo API.. I havent checked CHBs API v2 yet

Shoplifter 02-14-2021 01:02 PM

@sarettah this is very cool and wicked fast.

How could chat_room_url_revshare and image_url be modified to reflect a white label URL without slowing it down?

Otherwise adblock.

sarettah 02-14-2021 01:48 PM

Quote:

Originally Posted by Shoplifter (Post 22822026)
@sarettah this is very cool and wicked fast.

How could chat_room_url_revshare and image_url be modified to reflect a white label URL without slowing it down?

Otherwise adblock.

You shouldn't have to touch image_url. From what I see it is the chat_room_url that triggers the block.

You can modify the Chat room url ot pull from a whitelabel by just using:

Whitelabel + Username

So something like this (using my whitelabel at Hot Foxes at Camfoxes.net to link to):

txt +='<a rel=nofollow style="color:#000000;font-weight:bold;" href=https://www.camfoxes.net/' + xmlDoc.getElementsByTagName("username")[i].childNodes[0].nodeValue + '>';

Where I was using the chat room url from the feed before.

This appears to get past my adblockers and works on opera with ad blocking turnded on no problem:

https://madspiders.com/demo/cb_apiv2_demo4.htm

.

sarettah 02-14-2021 01:49 PM

Quote:

Originally Posted by Paul&John (Post 22822011)
No-no, I'm talking about AWEs Video Promo API.. I havent checked CHBs API v2 yet

Ah, when you mentioned limit and tags I just assumed. My bad.

Thanks

.

Shoplifter 02-14-2021 03:53 PM

Thanks Sarettah.

As a learning project I intend to use this to replace the WP Live Cam Wordpress theme I have running on a domain and it's huge Gigabyte size DB....

sarettah 02-15-2021 08:36 AM

I started in on 2 new sites yesterday using the pure javascript version.

Still have to do up some text and change up colors and shit but they are up and running.

https://dudefoxes.com

https://milffoxes.com


Still have to doctor them up for mobile too.

.

sarettah 02-15-2021 03:37 PM

Figured out the pagination today. Works pretty slick.

.

nikki99 02-15-2021 03:38 PM

2 pages of cams

Colmike9 02-15-2021 03:43 PM

50 API versions

sarettah 02-15-2021 04:09 PM

Quote:

Originally Posted by Colmike9 (Post 22822526)
50 API versions

Fiddy not 50 dammit. How long have you been here?

Fucking people can't do nothing right.

.

Shoplifter 02-15-2021 04:18 PM

I see what u did there to get around adblock. Did you use htaccess? I have gotten this far. I think it's counting.:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?mysite\.com$ [NC]
RewriteRule ^webcams(/.*)?$ https://chaturbate.com$1/?track=&tour=&campaign=WMID

sarettah 02-15-2021 05:17 PM

Quote:

Originally Posted by Shoplifter (Post 22822541)
I see what u did there to get around adblock. Did you use htaccess? I have gotten this far. I think it's counting.:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?mysite\.com$ [NC]
RewriteRule ^webcams(/.*)?$ https://chaturbate.com$1/?track=&tour=&campaign=WMID

Nope.

I could tell you what I am doing but then I would have to kill you. Seriously.

.

Colmike9 02-15-2021 05:51 PM

Quote:

Originally Posted by sarettah (Post 22822537)
Fiddy not 50 dammit. How long have you been here?

Fucking people can't do nothing right.

.

My 50 is pronounced 'fiddy', tho

sarettah 02-15-2021 10:00 PM

Looks like both API versions are down :(


Edited in: and now back up.

.

Andreweb 02-16-2021 03:31 AM

Cams doesn't load on Chrome on your sites(milffoxes.com, dudefoxes), at least not for me. They load fine on Mozilla and on Edge!

Paul&John 02-16-2021 05:19 AM

Loads here on chrome

sarettah 02-16-2021 07:35 AM

Quote:

Originally Posted by Andreweb (Post 22822729)
Cams doesn't load on Chrome on your sites(milffoxes.com, dudefoxes), at least not for me. They load fine on Mozilla and on Edge!

Hmm, loading fine for me in chrome.

I wonder what's up with that.

Thanks P&J.

.

sarettah 02-16-2021 07:44 PM

Anybody do anything with this code that they want to show off?

.

sarettah 02-17-2021 09:59 AM

Quote:

Originally Posted by sarettah (Post 22823008)
Anybody do anything with this code that they want to show off?

.


I guess that is a no.

Well, I finished up what I am going to do with Dudefoxes.com and MILFfoxes.com for now.

Put a warning page on them. Mixed some text in there. Still might add an about page to them to get some more text but for the most part they are done.

.

Paul&John 02-17-2021 11:34 AM

Quote:

Originally Posted by sarettah (Post 22823008)
Anybody do anything with this code that they want to show off?

.

Not yet, still busy counting my dollarz :(

ruff 02-17-2021 12:04 PM

This is great stuff. I'm going to spend hours fucking around with this because I know nothing and I might accidentally learn something. Thanks for the post.

sarettah 02-17-2021 02:54 PM

Here is another little piece.

In the return from the API a count of the number of cams on line that meet your criteria is included.

So, if you did not include any gender or tag parameter you would see the total number of cams online at that time.

If you included a gender parameter, you would see the total number of cams for that gender. Same for tags.

So, even if you are limiting your results by using the limit parameter you get to see the total number of cams that are available for that query.

That combined with the limit parameter and the offset parameter allows you to be able to create an effective pagination routine.

The total count is the first element in the xml:

Code:

<response>
    <count>9439</count>
  <results>
      <resource>
          <username>
            ...........

You can get at the count by using the getElementsByTagName() function.

for example:
camcount=xmlDoc.getElementsByTagName("count")[0].childNodes[0].nodeValue;

.

sarettah 02-18-2021 07:16 AM

Anybody interested in a full tutorial on building a site using api feeds?

A beginning to end, step by step type tuttorial?

.

Profits of Doom 02-18-2021 02:51 PM

Quote:

Originally Posted by sarettah (Post 22823669)
Anybody interested in a full tutorial on building a site using api feeds?

A beginning to end, step by step type tuttorial?

.

Coming from you absolutely, I know jack shit about coding but I always enjoy the stuff you post... :thumbsup

sarettah 02-18-2021 02:56 PM

For pagination:

Once you have the camcount it is easy to do pagination.

The total number of pages is the total cams divided by the number of cams per page.

I am using the number of cams that I am putting on each page as my limit parameter and I have it stored in a var called limit.

So, the number of pages is camcount/limit. However, that might not end up being an integer so to use that as the number of pages I use the ceiling function to round up to the nearest whole number.

maxpages=Math.ceil(camcount/limit);

So I now know how many total pages I have and I can make a pagination widget of some kind so the user can bounce through the pages or go to the page of their choosing.

If I know what page we are on then I can use the offset parameter on the api_url to pull the cams for that page.

We simply multiply the limit times the page number and we have the offset needed to grab that page of cams and we can then tack the offset parameter on to the url:

var offset=limit * pagenum;
api_url += '&offset=' + offset;

Getting the page number we are on is the harder task here.

Javascript does not have a built in function to read the url query string so if we want to use the url to get the next page we have some coding to do in javascript or we can grab the query on the server side in php.

I decided to use a different method. I am using an ajax call to grab the next page of data and then just loading it into the cams div.

In my pagination widget I set the page number variable to the page selected and then have a call to a function called change_page(). That function loads the page and then moves the browser view back to the top of the page. I could have just used load_page() but I wanted the animation effect of moving the page to the top. I might get rid of that because it is a little distracting to me.

In the edit/var section:

var pagenum=0;

In the pagination widget:

onClick="pagenum++;change_page(); (advance the page number by 1 and then change the page to that page number)

function change_page()
{
load_page();
document.getElementById("countdiv").scrollIntoView ({behavior: 'smooth'});
}

Hope that helps someone.

.

sarettah 02-18-2021 03:02 PM

Quote:

Originally Posted by Profits of Doom (Post 22823906)
Coming from you absolutely, I know jack shit about coding but I always enjoy the stuff you post... :thumbsup

I almost missed this. We cross posted.

Thanks.

.

sarettah 02-19-2021 09:42 AM

Quote:

Originally Posted by Profits of Doom (Post 22823906)
Coming from you absolutely, I know jack shit about coding but I always enjoy the stuff you post... :thumbsup

I don't think there is enough interest.

oh well.

.

boyboy4 02-19-2021 10:24 AM

Quote:

Originally Posted by sarettah (Post 22823669)
Anybody interested in a full tutorial on building a site using api feeds?

A beginning to end, step by step type tuttorial?

.

This is very interesting and we would be very grateful to you! :thumbsup

Shoplifter 02-19-2021 12:22 PM

Quote:

Originally Posted by sarettah (Post 22823669)
Anybody interested in a full tutorial on building a site using api feeds?

A beginning to end, step by step type tuttorial?

.

I'm interested.

I also had the thought that because the code is so slim it could be incorporated into other sites rather than just standalone.

sarettah 02-19-2021 01:12 PM

Quote:

Originally Posted by Shoplifter (Post 22824347)
I'm interested.

I also had the thought that because the code is so slim it could be incorporated into other sites rather than just standalone.

Yes, it lends it self to making widgets quite nicely.

.

Dennis69 02-21-2021 07:10 AM

Quote:

Originally Posted by sarettah (Post 22823669)
Anybody interested in a full tutorial on building a site using api feeds?

A beginning to end, step by step type tuttorial?

.

Yes for sure, was playing around with a few hours but would love to know how to do more with it!

sarettah 02-22-2021 11:31 AM

I will be trying to put something together. It will be a little while. I have several clients that have to come first.

.

mikeet 04-24-2021 02:53 PM

Quote:

Originally Posted by sarettah (Post 22823008)
Anybody do anything with this code that they want to show off?

.

I did something with it and don't want to show off :winkwink:

pm me if you want to see it..

Andreweb 04-25-2021 01:36 AM

Starting from your code I was able to do this website https://couplecams4k.com/ . Of course, it's still a work in progress and for chat rooms, I am still using version 1 of APIs because my coding skills are limited and I wasn't able to figure out how to make them in V2. Thanks again for sharing the code with us!

sarettah 04-25-2021 07:13 AM

Quote:

Originally Posted by Andreweb (Post 22851357)
Starting from your code I was able to do this website https://couplecams4k.com/ . Of course, it's still a work in progress and for chat rooms, I am still using version 1 of APIs because my coding skills are limited and I wasn't able to figure out how to make them in V2. Thanks again for sharing the code with us!

Cool.

.

marxxman 09-21-2021 05:17 PM

Amazing
 
Quote:

Originally Posted by sarettah (Post 22823669)
Anybody interested in a full tutorial on building a site using api feeds?

A beginning to end, step by step type tuttorial?

.

I am not a programmer and find it difficult to try to learn api's. I am trying to replace generic ads with live CB cams like this and finding this was a Godsend. I'm trying to figure out how to adjust the css for the performer names, when I look at it on mobile they all run together. I would be very grateful if anybody could steer me in the right direction on how to adjust this script so it's readable on any screen size, and where to add other fields like user age and number of users in the room. Anybody have any advice for a slow learner? I spend hours just spinning in circles.

e-god 11-27-2021 11:13 AM

Anyone have a complete script to run a site using this code? :)

Willing to buy.

Nubianprince 11-27-2021 04:23 PM

Quote:

Originally Posted by marxxman (Post 22916097)
I am not a programmer and find it difficult to try to learn api's. I am trying to replace generic ads with live CB cams like this and finding this was a Godsend. I'm trying to figure out how to adjust the css for the performer names, when I look at it on mobile they all run together. I would be very grateful if anybody could steer me in the right direction on how to adjust this script so it's readable on any screen size, and where to add other fields like user age and number of users in the room. Anybody have any advice for a slow learner? I spend hours just spinning in circles.

Try this for mobile
Code:

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {

 CSS HERE
 
}
/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {

 CSS HERE
 
}
/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {

 CSS HERE
 
}
/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {

 CSS HERE
 
}
/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {

 CSS HERE
 
}



All times are GMT -7. The time now is 09:22 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc