![]() |
Quote:
|
Quote:
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). . |
No-no, I'm talking about AWEs Video Promo API.. I havent checked CHBs API v2 yet
|
@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. |
Quote:
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 . |
Quote:
Thanks . |
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.... |
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. . |
Figured out the pagination today. Works pretty slick.
. |
2 pages of cams
|
50 API versions
|
Quote:
Fucking people can't do nothing right. . |
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 |
Quote:
I could tell you what I am doing but then I would have to kill you. Seriously. . |
Quote:
|
Looks like both API versions are down :(
Edited in: and now back up. . |
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!
|
Loads here on chrome
|
Quote:
I wonder what's up with that. Thanks P&J. . |
Anybody do anything with this code that they want to show off?
. |
Quote:
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. . |
Quote:
|
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.
|
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> for example: camcount=xmlDoc.getElementsByTagName("count")[0].childNodes[0].nodeValue; . |
Anybody interested in a full tutorial on building a site using api feeds?
A beginning to end, step by step type tuttorial? . |
Quote:
|
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. . |
Quote:
Thanks. . |
Quote:
oh well. . |
Quote:
|
Quote:
I also had the thought that because the code is so slim it could be incorporated into other sites rather than just standalone. |
Quote:
. |
Quote:
|
I will be trying to put something together. It will be a little while. I have several clients that have to come first.
. |
Quote:
pm me if you want to see it.. |
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!
|
Quote:
. |
Amazing
Quote:
|
Anyone have a complete script to run a site using this code? :)
Willing to buy. |
Quote:
Code:
/* Extra small devices (phones, 600px and down) */ |
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