Cams - Chaturbate API V2 parsing via JavaScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sarettah
    see you later, I'm gone
    • Oct 2002
    • 14297

    #1

    Tech Cams - Chaturbate API V2 parsing via JavaScript

    Have you wanted to build your own cams page from the Chaturbate API?

    This is a little bit of code to help get you started.

    It is based around Chaturbates API Version 2.

    The biggest change between Version 1 and Version 2 was that Version 2 wants the client IP to be passed in on the API request. This allows Chaturbate to filter the results based on what cams they allow to be shown in what region.

    With Version 1, the most common usage is to pull the results of the API server side and then cache it there, either as a file or in a database. Then dole out the results from the cache on each page hit. Typically you would do a pull from Chaturbate every 2-5 minutes to keep the cams fresh.

    With Version 2, it is expected that you will pull from the API on every page hit with the client ip for filtering. This means that instead of hitting the API once every 2-5 minutes, you are hitting it on every page hit. This is considerably more overhead for your server to handle.

    The solution? Move the API handling onto the client side. How do you do that? Using javascript and/or jquery.

    The following code is the javascript I came up with to do the API call and parse in the client's browser. It has been tested in Chrome, Opera and Firefox. It is a simple little bit of code that for most practical uses must be expanded upon. It will work as is but really should have other things with it, things like a design and text, ya know? All those cool web things.

    I am listing 2 different ways to pull in the API. The first is pure javascript, the second uses a jquery call to the AJAX object. To use the jquery version you need to include the jquery libraries. If you are already using jquery on your pages then it makes the most sense to use the jquery version. However, if you do not use jquery, are trying to keep your page load as low as possible, or are just a minimalist at heart, then you might want to use the pure javascript version.

    Either way, there are 2 parts.

    Part 1 is pull in the API data.

    Part 2 is parse the API data and display it.

    I have included some comments in the code to help you figure out what is happening but I left some for you to figure out yourself. I am including in here 2 working demos for you to view. Look under the sheets, play with the code.

    The code is running from a .php file. You could almost do all of this with pure javascript but unfortunately you cannot get ahold of the user's ip in javascript. You either have to grab it from your server or from a 3rd party service. I decided that the best way to grab it was from my server and I use php to accomplish that. Since I am already in a php file I decided to utilize a little more code to make the solution a little more dynamic.

    Have fun.

    Code:
    // Chaturbate API Version 2 
    // xml feed pull and parse using javascript called from php
    
    // by sarettah - Hatteras Designs 2021
    // sarettah AT hatterasdesigns.com
    
    // requires jquery libraries for the jquery ajax call
    // could be done pure client side with the exception of the user ip.
    // that would have to be called from a service or injected here as I did
    
    // this section would go near the top of the page to make for easy editing
    <?php 
      // edit area 
      $wmid='chaturbate webmaster Id';
      $tag='bigdick';    
      $gender='t';
      $limit=50;  
      $camsdiv='name of cams div';
      // end of edit area
    
      // construct the api url 
      $api_url="https://chaturbate.com/api/public/affiliates/onlinerooms/?wm=" . $wmid . "&format=xml&client_ip=" . $_SERVER['REMOTE_ADDR'];
      
      if($limit>0)
      {
        $api_url .="&limit=" . $limit;
      }
      if($tag>'')
      {
        $api_url .="&tag=" . $tag;
      }
      if($gender>'')
      {
        $api_url .="&gender=" . $genderl;
      }
    ?>
    
    // Here are 2 different ways to pull in the xml feed into the page 
    // both methods call the parse data function.
    // Either of these would appear in your page somewhere after the cams div 
    // Can be called inline in the page OR from the document ready function
    
    // Pulling the xml page via pure javascript AJAX call
    <script>
    pathin="<?php echo $api_url; ?>";
    if (window.XMLHttpRequest)
    {
      dirpage=new XMLHttpRequest();
    }
    else
    {
      dirpage=new ActiveXObject("Microsoft.XMLHTTP");
    }
    dirpage.onreadystatechange=function()
    {
      if (dirpage.readyState==4 && dirpage.status==200)
      {
         parse_data(dirpage.responseText, "<?php echo $camsdiv; ?>");
      }
      dirpage.open("GET",pathin,true);
      dirpage.send();
    }
    </script>
    
    // OR
    //Pulling the xml page via a jquery AJAX call
    <script>
          $.ajax({
            dataType: "html",
            url: "<?php echo $api_url; ?>",
            success: function (data) {
                //console.log(data);
                parse_data(data, "<?php echo $camsdiv; ?>");
            }
          });
    </script>
    
    
    <script>
    // The parse data function parses the xml data and formats the cam element division.
    // It then appends the result to the cams div
    
    function parse_data(data, camsdiv)
    {
      parser = new DOMParser();
      xmlDoc = parser.parseFromString(data,"text/xml");
      x=xmlDoc.getElementsByTagName("username");
      txt='';
      
      for (i = 0; i < x.length ;i++) 
      {
        // construct your cam element here
        // for example
        txt +='<div>';
        txt +='<a href=' + xmlDoc.getElementsByTagName("chatroom_url_revshare")[i].childNodes[0].nodeValue; 
        txt +='Username: ' + xmlDoc.getElementsByTagName("username")[i].childNodes[0].nodeValue + '<br>';
        txt +='<img src=' + xmlDoc.getElementsByTagName("image_url")[i].childNodes[0].nodeValue + '><br>';
        
        // use other xml elements from the api as needed..........
        // each element is called using the getelementsbytagname function and displaying their respective values
        
        txt +='</a>';
        txt +='</div>';
        
        // add the element to the div
        document.getElementById(camsdiv).innerHTML +=txt;
        txt='';
      }
    }
    </script>

    .
    All cookies cleared!
  • sarettah
    see you later, I'm gone
    • Oct 2002
    • 14297

    #2
    Example 1 - Using Javascript for the ajax api call:

    https://madspiders.com/demo/cb_apiv2_demo1.php

    Example 1 source code:

    Code:
    <?php 
      // edit area 
      $wmid='xxxxx';
      $tag='18';    
      $gender='f';
      $limit=32;  
      $camsdiv='camsdiv';
      // end of edit area
    
      // construct the api url 
      $api_url="https://chaturbate.com/api/public/affiliates/onlinerooms/?wm=" . $wmid . "&format=xml&client_ip=" . $_SERVER['REMOTE_ADDR'];
      
      if($limit>0)
      {
        $api_url .="&limit=" . $limit;
      }
      if($tag>'')
      {
        $api_url .="&tag=" . $tag;
      }
      if($gender>'')
      {
        $api_url .="&gender=" . $gender;
      }
    ?>
    <html>
    <head>
    <base href="https://gfy.com/" /><!--[if IE]></base><![endif]-->
    <meta http-equiv="content-type" content="text/html; charset=windows-1250">         
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Example of pulling CB API Version 2</title>
    
    <script>
    function parse_data(data, camsdiv)
    {
      parser = new DOMParser();
      xmlDoc = parser.parseFromString(data,"text/xml");
      x=xmlDoc.getElementsByTagName("username");
      txt='';
      
      for (i = 0; i < x.length ;i++) 
      {
        txt +='<div style="float:left;width:25%;margin-bottom:10px;padding:right:10px;text-align:center;">';
        txt +='<a rel=nofollow style="color:#000000;font-weight:bold;" href=' + xmlDoc.getElementsByTagName("chat_room_url_revshare")[i].childNodes[0].nodeValue + '>'; 
        txt +=xmlDoc.getElementsByTagName("username")[i].childNodes[0].nodeValue + '<br>';
        txt +='<img style="max-width:90%;" src=' + xmlDoc.getElementsByTagName("image_url")[i].childNodes[0].nodeValue + '><br>';
        txt +='</a>';
        txt +='</div>';
       
        document.getElementById(camsdiv).innerHTML +=txt;
        txt='';
      }
    }
    </script>
    </head>
    <body>
    <div style="width:100%;text-align:center;">
    <h1>Example of pulling Chaturbate API Version 2 using pure javascript</h1>
    <br>
    <div name="camsdiv" id="camsdiv" style="margin-left:15px;">
    </div>
    </div>
    <script>
    pathin="<?php echo $api_url; ?>";
    
    if (window.XMLHttpRequest)
    {
      dirpage=new XMLHttpRequest();
    }
    else
    {
      dirpage=new ActiveXObject("Microsoft.XMLHTTP");
    }
    dirpage.onreadystatechange=function()
    {
      if (dirpage.readyState==4 && dirpage.status==200)
      {
         parse_data(dirpage.responseText, "<?php echo $camsdiv; ?>");
      }
    }
    dirpage.open("GET",pathin,true);
    dirpage.send();
    
    </script>
    
    </body>
    </html>
    All cookies cleared!

    Comment

    • sarettah
      see you later, I'm gone
      • Oct 2002
      • 14297

      #3
      Example 2: Using jquery for the ajax api call:

      https://madspiders.com/demo/cb_apiv2_demo2.php

      Example 2 source code:

      Code:
      <?php 
        // edit area 
        $wmid='xxxxx';
        $tag='18';    
        $gender='f';
        $limit=32;  
        $camsdiv='camsdiv';
        // end of edit area
      
        // construct the api url 
        $api_url="https://chaturbate.com/api/public/affiliates/onlinerooms/?wm=" . $wmid . "&format=xml&client_ip=" . $_SERVER['REMOTE_ADDR'];
        
        if($limit>0)
        {
          $api_url .="&limit=" . $limit;
        }
        if($tag>'')
        {
          $api_url .="&tag=" . $tag;
        }
        if($gender>'')
        {
          $api_url .="&gender=" . $gender;
        }
      ?>
      <html>
      <head>
      <base href="https://gfy.com/" /><!--[if IE]></base><![endif]-->
      <meta http-equiv="content-type" content="text/html; charset=windows-1250">         
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Example of pulling CB API Version 2</title>
      
      <script src="//code.jquery.com/jquery-1.10.2.js"></script>
      
      <script>
      function parse_data(data, camsdiv)
      {
        parser = new DOMParser();
        xmlDoc = parser.parseFromString(data,"text/xml");
        x=xmlDoc.getElementsByTagName("username");
        txt='';
        
        for (i = 0; i < x.length ;i++) 
        {
          txt +='<div style="float:left;width:25%;margin-bottom:10px;padding:right:10px;text-align:center;">';
          txt +='<a rel=nofollow style="color:#000000;font-weight:bold;" href=' + xmlDoc.getElementsByTagName("chat_room_url_revshare")[i].childNodes[0].nodeValue + '>'; 
          txt +=xmlDoc.getElementsByTagName("username")[i].childNodes[0].nodeValue + '<br>';
          txt +='<img style="max-width:90%;" src=' + xmlDoc.getElementsByTagName("image_url")[i].childNodes[0].nodeValue + '><br>';
          txt +='</a>';
          txt +='</div>';
         
          document.getElementById(camsdiv).innerHTML +=txt;
          txt='';
        }
      }
      </script>
      </head>
      <body>
      <div style="width:100%;text-align:center;">
      <h1>Example of pulling Chaturbate API Version 2 using javascript and AJAX</h1>
      <br>
      <div name="camsdiv" id="camsdiv" style="margin-left:15px;">
      </div>
      </div>
      
      <script>
            $.ajax({
              dataType: "html",
              url: "<?php echo $api_url; ?>",
              success: function (data) {
                  //console.log(data);
                  parse_data(data, "<?php echo $camsdiv; ?>");
              }
            });
      </script>
      
      </body>
      </html>
      All cookies cleared!

      Comment

      • sarettah
        see you later, I'm gone
        • Oct 2002
        • 14297

        #4
        For the record the <base href tag is not actually part of the source code. GFY is inserting that into the post.

        Code:
        <base href="https://gfy.com/" /><!--[if IE]></base><![endif]-->
        .
        All cookies cleared!

        Comment

        • Paul&John
          Confirmed User
          • Aug 2005
          • 8643

          #5
          sarettah to the rescue as always, big thumbs up ;)
          Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo!
          Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here

          Comment

          • fuzebox
            making it rain
            • Oct 2003
            • 22351

            #6
            Nicely done

            Comment

            • mechanicvirus
              Confirmed User
              • Feb 2005
              • 4219

              #7
              Great stuff, sarretah knows his shit.

              Comment

              • CB Kitt
                Confirmed User
                • Nov 2019
                • 104

                #8
                Thanks for posting this. We encourage all affiliates to use the new API where possible.

                FYI when calling from the client side, you do not need to pass the ip, you can just set it to "request_ip".

                Please see our documentation (chaturbate[dot]com/affiliates/promotools/api_usersonline/) for more information.

                Chaturbate Affiliate Support: [email protected]

                Comment

                • CaptainHowdy
                  Too lazy to set a custom title
                  • Dec 2004
                  • 94731

                  #9
                  We love you, sarettah . . . even though you hate us.

                  Comment

                  • Colmike9
                    (>^_^)b
                    • Dec 2011
                    • 7230

                    #10
                    Nice! I need to do more with cams, traffic for me has been going up.
                    Join the BEST cam affiliate program on the internet!
                    I've referred over $1.7mil in spending this past year, you should join in.
                    I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

                    Comment

                    • sarettah
                      see you later, I'm gone
                      • Oct 2002
                      • 14297

                      #11
                      Originally posted by CB Kitt
                      Thanks for posting this. We encourage all affiliates to use the new API where possible.

                      FYI when calling from the client side, you do not need to pass the ip, you can just set it to "request_ip".

                      Please see our documentation (chaturbate[dot]com/affiliates/promotools/api_usersonline/) for more information.


                      Thanks for that. I will make a note of it.

                      Here is the link for the docs (You really need to post more there Kitt. Get up there above 30 posts so you can post links and show us your tits and all that). https://chaturbate.com/affiliates/pr...i_usersonline/

                      You need to be logged in to chaturbate to read the docs

                      Don't have a Chaturbate account? You can sign up here with my ref code https://www.camfoxes.com/webcams/webmaster_signup.htm

                      Or you can sign up directly at Chaturbate https://chaturbate.com/affiliates/

                      Bith links load real slow tright now so please be patient.
                      All cookies cleared!

                      Comment

                      • sarettah
                        see you later, I'm gone
                        • Oct 2002
                        • 14297

                        #12
                        Originally posted by CaptainHowdy
                        We love you, sarettah . . . even though you hate us.
                        What?? When did I ever say I hated you (or anybody).

                        You are one of my favorite posters.

                        .
                        All cookies cleared!

                        Comment

                        • Colmike9
                          (>^_^)b
                          • Dec 2011
                          • 7230

                          #13
                          Originally posted by sarettah
                          Bith links load real slow tright now so please be patient.
                          The Chaturbate link in my sig loads faster, so I think people should use that one instead.
                          Join the BEST cam affiliate program on the internet!
                          I've referred over $1.7mil in spending this past year, you should join in.
                          I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

                          Comment

                          • sarettah
                            see you later, I'm gone
                            • Oct 2002
                            • 14297

                            #14
                            Hmm. I was just putting together a new demo using the info that Kitt provided.

                            During testing I noticed that it loaded really slowly.

                            So, I went back and looked at the other 2 demos I posted and they are now seeming to take a while to load, about 15 seconds.

                            Earlier they were popping right in.

                            Don't know if the api is running slow or what the issue is.

                            I just know it was working fine and now it is a slow load.

                            .
                            All cookies cleared!

                            Comment

                            • Colmike9
                              (>^_^)b
                              • Dec 2011
                              • 7230

                              #15
                              Originally posted by sarettah
                              Hmm. I was just putting together a new demo using the info that Kitt provided.

                              During testing I noticed that it loaded really slowly.

                              So, I went back and looked at the other 2 demos I posted and they are now seeming to take a while to load, about 15 seconds.

                              Earlier they were popping right in.

                              Don't know if the api is running slow or what the issue is.

                              I just know it was working fine and now it is a slow load.

                              .
                              Some of the cams on the main site aren't loading right now, either. The splash comes up but then a constant spinning load animation. Then once in a while when I refresh, it loads but then like 3fps.
                              Join the BEST cam affiliate program on the internet!
                              I've referred over $1.7mil in spending this past year, you should join in.
                              I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

                              Comment

                              • sarettah
                                see you later, I'm gone
                                • Oct 2002
                                • 14297

                                #16
                                Sample using just javascript - no php. Using request_ip in the client_ip parameter.

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

                                Source:
                                Code:
                                <html>
                                <head>
                                <base href="https://gfy.com/" /><!--[if IE]></base><![endif]-->
                                <base href="https://gfy.com/" /><!--[if IE]></base><![endif]-->
                                <base href="https://gfy.com/" /><!--[if IE]></base><![endif]-->
                                <meta http-equiv="content-type" content="text/html; charset=windows-1250">         
                                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                                <title>Example of pulling CB API Version 2</title>
                                
                                <script>
                                  // edit area 
                                  var wmid='xxxxx';
                                  var tag='18';    
                                  var gender='f';
                                  var limit=32;  
                                  var camsdiv='camsdiv';
                                  // end of edit area
                                
                                  // construct the api url 
                                  api_url="https://chaturbate.com/api/public/affiliates/onlinerooms/?wm=" + wmid + "&format=xml&client_ip=request_ip";
                                  
                                  if(limit>0)
                                  {
                                    api_url +="&limit=" + limit;
                                  }
                                  if(tag>'')
                                  {
                                    api_url +="&tag=" + tag;
                                  }
                                  if(gender>'')
                                  {
                                    api_url +="&gender=" + gender;
                                  }
                                </script>
                                <script>
                                function parse_data(data, camsdiv)
                                {
                                  parser = new DOMParser();
                                  xmlDoc = parser.parseFromString(data,"text/xml");
                                  x=xmlDoc.getElementsByTagName("username");
                                  txt='';
                                  
                                  for (i = 0; i < x.length ;i++) 
                                  {
                                    txt +='<div style="float:left;width:25%;margin-bottom:10px;padding:right:10px;text-align:center;">';
                                    txt +='<a rel=nofollow style="color:#000000;font-weight:bold;" href=' + xmlDoc.getElementsByTagName("chat_room_url_revshare")[i].childNodes[0].nodeValue + '>'; 
                                    txt +=xmlDoc.getElementsByTagName("username")[i].childNodes[0].nodeValue + '<br>';
                                    txt +='<img style="max-width:90%;" src=' + xmlDoc.getElementsByTagName("image_url")[i].childNodes[0].nodeValue + '><br>';
                                    txt +='</a>';
                                    txt +='</div>';
                                   
                                    document.getElementById(camsdiv).innerHTML +=txt;
                                    txt='';
                                  }
                                }
                                </script>
                                </head>
                                <body>
                                <div style="width:100%;text-align:center;">
                                <h1>Example of pulling Chaturbate API Version 2 using just javascript</h1>
                                <br>
                                <div name="camsdiv" id="camsdiv" style="margin-left:15px;">
                                </div>
                                </div>
                                
                                <script>
                                if (window.XMLHttpRequest)
                                {
                                  dirpage=new XMLHttpRequest();
                                }
                                else
                                {
                                  dirpage=new ActiveXObject("Microsoft.XMLHTTP");
                                }
                                dirpage.onreadystatechange=function()
                                {
                                  if (dirpage.readyState==4 && dirpage.status==200)
                                  {
                                     parse_data(dirpage.responseText, camsdiv);
                                  }
                                }
                                dirpage.open("GET",api_url,true);
                                dirpage.send();
                                
                                </script>
                                
                                </body>
                                </html>
                                As I said in the previous post, right now the api seems to be coming back slower than it has been. Still looking to see if it is my problem or on their end.

                                .
                                All cookies cleared!

                                Comment

                                • sarettah
                                  see you later, I'm gone
                                  • Oct 2002
                                  • 14297

                                  #17
                                  Originally posted by Colmike9
                                  The Chaturbate link in my sig loads faster, so I think people should use that one instead.

                                  Yeah but you aren't real well known for that thinking stuff.

                                  .
                                  All cookies cleared!

                                  Comment

                                  • Colmike9
                                    (>^_^)b
                                    • Dec 2011
                                    • 7230

                                    #18
                                    Originally posted by sarettah
                                    Yeah but you aren't real well known for that thinking stuff.

                                    .
                                    You're thinking of Colmike7
                                    Join the BEST cam affiliate program on the internet!
                                    I've referred over $1.7mil in spending this past year, you should join in.
                                    I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

                                    Comment

                                    • sarettah
                                      see you later, I'm gone
                                      • Oct 2002
                                      • 14297

                                      #19
                                      Originally posted by Colmike9
                                      You're thinking of Colmike7
                                      I try not to think of any of you.

                                      .
                                      All cookies cleared!

                                      Comment

                                      • Colmike9
                                        (>^_^)b
                                        • Dec 2011
                                        • 7230

                                        #20
                                        Originally posted by sarettah
                                        I try not to think of any of you.

                                        .
                                        Still happens, tho
                                        Join the BEST cam affiliate program on the internet!
                                        I've referred over $1.7mil in spending this past year, you should join in.
                                        I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

                                        Comment

                                        • sarettah
                                          see you later, I'm gone
                                          • Oct 2002
                                          • 14297

                                          #21
                                          All the demos seem to be working fine now.

                                          That is one of the problems of pulling teh api every hit, you become a slave to the api.

                                          If the data from the api is stored on the server then you can reload the old data again when the api pull fails.

                                          Might be a way to delay clearing the page on a hit so that you could check for a good return but I am not sure what that way would be at the moment. Have ot think on that.

                                          .
                                          All cookies cleared!

                                          Comment

                                          • sarettah
                                            see you later, I'm gone
                                            • Oct 2002
                                            • 14297

                                            #22
                                            I just had a conversation with another programmer (whom I respect very much). He had seen the code and suggested a couple of changes in the .php versions of the code.

                                            When getting the ip I was simply using the Server var for the Remote Ip ($_SERVER['REMOTE_ADDR']).

                                            He suggested that for someone hosting with a forwarding service, such as cloudflare, that the Remote Addr var would always return Cloudflare's ip.

                                            So to get to the real ip we have to do a little shuffling through the various server vars we have available and the code ends up looking something like:

                                            Code:
                                              
                                              $clientip='';
                                              if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP'] != "") 
                                              {
                                                $clientip = addslashes($_SERVER['HTTP_CLIENT_IP']);
                                              } 
                                              else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != "") 
                                              {
                                                $clientip = addslashes($_SERVER['HTTP_X_FORWARDED_FOR']);
                                              } 
                                              else 
                                              {
                                                $clientip = addslashes($_SERVER['REMOTE_ADDR']);
                                              }
                                            He also reminded me to always escape the server vars as a security step.

                                            So I am changing up the 2 php demos to utilize this methodology.


                                            Thanks to K0nr4d (https://gfy.com/members/k0nr4d/) for the advice. https://www.mechbunny.com/ is Konr4d's baby if you did not know that already.



                                            .
                                            All cookies cleared!

                                            Comment

                                            • sarettah
                                              see you later, I'm gone
                                              • Oct 2002
                                              • 14297

                                              #23
                                              https://madspiders.com/demo/cb_apiv2_demo1.php

                                              Demo 1 new source code:

                                              Code:
                                              <?php 
                                                // edit area 
                                                $wmid='JkjyU';
                                                $tag='18';    
                                                $gender='f';
                                                $limit=32;  
                                                $camsdiv='camsdiv';
                                                // end of edit area
                                              
                                                // pulling client ip 
                                                $client_ip='';
                                                if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP'] != "") 
                                                {
                                                  $clientip = addslashes($_SERVER['HTTP_CLIENT_IP']);
                                                } 
                                                else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != "") 
                                                {
                                                  $clientip = addslashes($_SERVER['HTTP_X_FORWARDED_FOR']);
                                                } 
                                                else 
                                                {
                                                  $clientip = addslashes($_SERVER['REMOTE_ADDR']);
                                                }
                                              
                                                // construct the api url 
                                                $api_url="https://chaturbate.com/api/public/affiliates/onlinerooms/?wm=" . $wmid . "&format=xml&client_ip=" . $clientip;
                                                
                                                if($limit>0)
                                                {
                                                  $api_url .="&limit=" . $limit;
                                                }
                                                if($tag>'')
                                                {
                                                  $api_url .="&tag=" . $tag;
                                                }
                                                if($gender>'')
                                                {
                                                  $api_url .="&gender=" . $gender;
                                                }
                                              ?>
                                              <html>
                                              <head>
                                              <base href="https://gfy.com/" /><!--[if IE]></base><![endif]-->
                                              <meta http-equiv="content-type" content="text/html; charset=windows-1250">         
                                              <meta name="viewport" content="width=device-width, initial-scale=1.0">
                                              <title>Example of pulling CB API Version 2</title>
                                              
                                              <script>
                                              function parse_data(data, camsdiv)
                                              {
                                                parser = new DOMParser();
                                                xmlDoc = parser.parseFromString(data,"text/xml");
                                                x=xmlDoc.getElementsByTagName("username");
                                                txt='';
                                                
                                                for (i = 0; i < x.length ;i++) 
                                                {
                                                  txt +='<div style="float:left;width:25%;margin-bottom:10px;padding:right:10px;text-align:center;">';
                                                  txt +='<a rel=nofollow style="color:#000000;font-weight:bold;" href=' + xmlDoc.getElementsByTagName("chat_room_url_revshare")[i].childNodes[0].nodeValue + '>'; 
                                                  txt +=xmlDoc.getElementsByTagName("username")[i].childNodes[0].nodeValue + '<br>';
                                                  txt +='<img style="max-width:90%;" src=' + xmlDoc.getElementsByTagName("image_url")[i].childNodes[0].nodeValue + '><br>';
                                                  txt +='</a>';
                                                  txt +='</div>';
                                                 
                                                  document.getElementById(camsdiv).innerHTML +=txt;
                                                  txt='';
                                                }
                                              }
                                              </script>
                                              </head>
                                              <body>
                                              <div style="width:100%;text-align:center;">
                                              <h1>Example of pulling Chaturbate API Version 2 using pure javascript</h1>
                                              <br>
                                              <div name="camsdiv" id="camsdiv" style="margin-left:15px;">
                                              </div>
                                              </div>
                                              <script>
                                              pathin="<?php echo $api_url; ?>";
                                              
                                              if (window.XMLHttpRequest)
                                              {
                                                dirpage=new XMLHttpRequest();
                                              }
                                              else
                                              {
                                                dirpage=new ActiveXObject("Microsoft.XMLHTTP");
                                              }
                                              dirpage.onreadystatechange=function()
                                              {
                                                if (dirpage.readyState==4 && dirpage.status==200)
                                                {
                                                   parse_data(dirpage.responseText, "<?php echo $camsdiv; ?>");
                                                }
                                              }
                                              dirpage.open("GET",pathin,true);
                                              dirpage.send();
                                              
                                              </script>
                                              
                                              </body>
                                              </html>
                                              .
                                              All cookies cleared!

                                              Comment

                                              • sarettah
                                                see you later, I'm gone
                                                • Oct 2002
                                                • 14297

                                                #24
                                                https://madspiders.com/demo/cb_apiv2_demo2.php

                                                Demo 2 new source code:

                                                Code:
                                                <?php 
                                                  // edit area 
                                                  $wmid='JkjyU';
                                                  $tag='18';    
                                                  $gender='f';
                                                  $limit=32;  
                                                  $camsdiv='camsdiv';
                                                  // end of edit area
                                                  // pulling client ip 
                                                
                                                  $client_ip='';
                                                  if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP'] != "") 
                                                  {
                                                    $clientip = addslashes($_SERVER['HTTP_CLIENT_IP']);
                                                  } 
                                                  else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != "") 
                                                  {
                                                    $clientip = addslashes($_SERVER['HTTP_X_FORWARDED_FOR']);
                                                  } 
                                                  else 
                                                  {
                                                    $clientip = addslashes($_SERVER['REMOTE_ADDR']);
                                                  }
                                                
                                                  // construct the api url 
                                                  $api_url="https://chaturbate.com/api/public/affiliates/onlinerooms/?wm=" . $wmid . "&format=xml&client_ip=" . $clientip;
                                                  
                                                  if($limit>0)
                                                  {
                                                    $api_url .="&limit=" . $limit;
                                                  }
                                                  if($tag>'')
                                                  {
                                                    $api_url .="&tag=" . $tag;
                                                  }
                                                  if($gender>'')
                                                  {
                                                    $api_url .="&gender=" . $gender;
                                                  }
                                                ?>
                                                <html>
                                                <head>
                                                <base href="https://gfy.com/" /><!--[if IE]></base><![endif]-->
                                                <meta http-equiv="content-type" content="text/html; charset=windows-1250">         
                                                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                                                <title>Example of pulling CB API Version 2</title>
                                                
                                                <script src="//code.jquery.com/jquery-1.10.2.js"></script>
                                                
                                                <script>
                                                function parse_data(data, camsdiv)
                                                {
                                                  parser = new DOMParser();
                                                  xmlDoc = parser.parseFromString(data,"text/xml");
                                                  x=xmlDoc.getElementsByTagName("username");
                                                  txt='';
                                                  
                                                  for (i = 0; i < x.length ;i++) 
                                                  {
                                                    txt +='<div style="float:left;width:25%;margin-bottom:10px;padding:right:10px;text-align:center;">';
                                                    txt +='<a rel=nofollow style="color:#000000;font-weight:bold;" href=' + xmlDoc.getElementsByTagName("chat_room_url_revshare")[i].childNodes[0].nodeValue + '>'; 
                                                    txt +=xmlDoc.getElementsByTagName("username")[i].childNodes[0].nodeValue + '<br>';
                                                    txt +='<img style="max-width:90%;" src=' + xmlDoc.getElementsByTagName("image_url")[i].childNodes[0].nodeValue + '><br>';
                                                    txt +='</a>';
                                                    txt +='</div>';
                                                   
                                                    document.getElementById(camsdiv).innerHTML +=txt;
                                                    txt='';
                                                  }
                                                }
                                                </script>
                                                </head>
                                                <body>
                                                <div style="width:100%;text-align:center;">
                                                <h1>Example of pulling Chaturbate API Version 2 using javascript and AJAX</h1>
                                                <br>
                                                <div name="camsdiv" id="camsdiv" style="margin-left:15px;">
                                                </div>
                                                </div>
                                                
                                                <script>
                                                      $.ajax({
                                                        dataType: "html",
                                                        url: "<?php echo $api_url; ?>",
                                                        success: function (data) {
                                                            //console.log(data);
                                                            parse_data(data, "<?php echo $camsdiv; ?>");
                                                        }
                                                      });
                                                </script>
                                                
                                                </body>
                                                </html>
                                                .
                                                All cookies cleared!

                                                Comment

                                                • CaptainHowdy
                                                  Too lazy to set a custom title
                                                  • Dec 2004
                                                  • 94731

                                                  #25
                                                  Originally posted by sarettah
                                                  What?? When did I ever say I hated you (or anybody).

                                                  You are one of my favorite posters.

                                                  .

                                                  Comment

                                                  • fuzebox
                                                    making it rain
                                                    • Oct 2003
                                                    • 22351

                                                    #26
                                                    Originally posted by sarettah
                                                    I just had a conversation with another programmer (whom I respect very much). He had seen the code and suggested a couple of changes in the .php versions of the code.

                                                    When getting the ip I was simply using the Server var for the Remote Ip ($_SERVER['REMOTE_ADDR']).

                                                    He suggested that for someone hosting with a forwarding service, such as cloudflare, that the Remote Addr var would always return Cloudflare's ip.

                                                    So to get to the real ip we have to do a little shuffling through the various server vars we have available and the code ends up looking something like:

                                                    Code:
                                                      
                                                      $clientip='';
                                                      if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP'] != "") 
                                                      {
                                                        $clientip = addslashes($_SERVER['HTTP_CLIENT_IP']);
                                                      } 
                                                      else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != "") 
                                                      {
                                                        $clientip = addslashes($_SERVER['HTTP_X_FORWARDED_FOR']);
                                                      } 
                                                      else 
                                                      {
                                                        $clientip = addslashes($_SERVER['REMOTE_ADDR']);
                                                      }
                                                    He also reminded me to always escape the server vars as a security step.

                                                    So I am changing up the 2 php demos to utilize this methodology.


                                                    Thanks to K0nr4d (https://gfy.com/members/k0nr4d/) for the advice. https://www.mechbunny.com/ is Konr4d's baby if you did not know that already.



                                                    .
                                                    Cloudflare has their own headers for you to substitute into your code. REMOTE_ADDR is HTTP_CF_CONNECTING_IP.

                                                    Comment

                                                    • sarettah
                                                      see you later, I'm gone
                                                      • Oct 2002
                                                      • 14297

                                                      #27
                                                      Originally posted by fuzebox
                                                      Cloudflare has their own headers for you to substitute into your code. REMOTE_ADDR is HTTP_CF_CONNECTING_IP.
                                                      Thanks WOTY

                                                      .
                                                      All cookies cleared!

                                                      Comment

                                                      • sarettah
                                                        see you later, I'm gone
                                                        • Oct 2002
                                                        • 14297

                                                        #28
                                                        So based on what Fuzebox said, if you are hosting on cloudflare and were doing this with php you would want to check for Cloudflare's custom server var (HTTP_CF_CONNECTING_IP) for handling the ip.

                                                        Code:
                                                          $clientip='';
                                                        
                                                          if (isset($_SERVER['HTTP_CF_CONNECTING_IP']) && $_SERVER['HTTP_CF_CONNECTING_IP'] != "")
                                                          {
                                                            $clientip = addslashes($_SERVER['HTTP_CF_CONNECTING_IP']);
                                                          }
                                                          elseif (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP'] != "") 
                                                          {
                                                            $clientip = addslashes($_SERVER['HTTP_CLIENT_IP']);
                                                          } 
                                                          else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != "") 
                                                          {
                                                            $clientip = addslashes($_SERVER['HTTP_X_FORWARDED_FOR']);
                                                          } 
                                                          else 
                                                          {
                                                            $clientip = addslashes($_SERVER['REMOTE_ADDR']);
                                                          }
                                                        .
                                                        All cookies cleared!

                                                        Comment

                                                        • Paul&John
                                                          Confirmed User
                                                          • Aug 2005
                                                          • 8643

                                                          #29
                                                          Originally posted by CB Kitt
                                                          Thanks for posting this. We encourage all affiliates to use the new API where possible.

                                                          FYI when calling from the client side, you do not need to pass the ip, you can just set it to "request_ip".

                                                          Please see our documentation (chaturbate[dot]com/affiliates/promotools/api_usersonline/) for more information.

                                                          Any plans for disabling API v1?
                                                          Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo!
                                                          Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here

                                                          Comment

                                                          • Andreweb
                                                            Confirmed User
                                                            • Mar 2013
                                                            • 2431

                                                            #30
                                                            Sarettah you are the best! Thank you for sharing this with us! You already helped me and other people a lot around here
                                                            Make Money With: Chaturbate
                                                            Cheap Reliable Hosting

                                                            Comment

                                                            • Fred - Nexturbate
                                                              Confirmed User
                                                              • Mar 2019
                                                              • 89

                                                              #31
                                                              Can you tell me what is the advantage of using API version 2? Because version 1 is quite functional, and there is no such "problem" with ip.
                                                              Thank you
                                                              Discord for Link Exchange from Adult Webmasters: https://discord.gg/uqaJRbA5

                                                              Comment

                                                              • sarettah
                                                                see you later, I'm gone
                                                                • Oct 2002
                                                                • 14297

                                                                #32
                                                                Originally posted by Fred - Nexturbate
                                                                Can you tell me what is the advantage of using API version 2? Because version 1 is quite functional, and there is no such "problem" with ip.
                                                                Thank you
                                                                First of all the disclaimer: I am NOT an employee of Chaturbate, I am an affiliate just like the rest of you.

                                                                I do not know what advantages Chaturbate intended on v2 versus v1.

                                                                I can tell you the advantages I see, but it will be totally from my perspective.

                                                                V1 was never really (imho) intended to be pulled on every hit. It returns all cams every time you call it. Each time it is called you have to process through the entire set of cams to do the various things you want to do.

                                                                V2 allows several passins that limit the return set.

                                                                limit= controls the number of records coming back
                                                                offset= controls where in the return set to start
                                                                exhibitionist= I am not sure what that will do, have not explored it yet,
                                                                gender= allows you to select a single gender or all genders
                                                                region= allows you to return cams for just a certain region
                                                                tag= returns records for certain tags
                                                                hd= returns records for hd cams

                                                                Then there is the client_ip parameter. This allows Chaturbate to filter based on a performers setting whether the cam should appear in the set based on the users country or locality. Version 1 has a field for countries allowed but it has always been empty. If it was filled it would have been up to you to do a lookup by ip to see if the user on your site should see the cam or not. This should eliminate some of the issues of putting a cam up and when you click it coming back saying that you are not allowed to see it.

                                                                These new parameters allow you to more finitely control the return set. It also allows the api to be much more efficient in that it does not have to be returning as many records and you don't have to handle as many records. So, with V2 you can realistically call it on every hit and still have a fast site.

                                                                There are disadvantages too. With Version 2 it is harder to do certain things. For example, I have several sites that are based off the age of the model (18yearoldcams, 1821camgirls, milffoxes(coming)). To do those with V2, using it the way it is intended, would be a major pain in the ass as there is no pass in to return just certain age cams. I would have to circumvent what Chaturbate wants to do and still use V2 like it was V1, pulling it into the database so that I could spit out just the cams I want.

                                                                I also like to do certain sorts. By age, location, etc. Doing these effectively with V2 would be another PITA. You would have to pull in all cams, sort them and then present the proper set. So again, I would probably be circumventing Chaturbate's intended use of V2 and instead use it as I use V1 and load it all to a database every 5 minutes.

                                                                Another disadvantage showed itself yesterday. While I was making this thread, the api slowed down for some reason. This made all my demos break basically. I don't have to worry about that on the sites I am loading using V1. On those I load a database. If the API does not return for me I just use the old set of cams until the API comes back. I am never without cams. That is not true if you are using V2 on every hit. On V2, you are basically presenting what is in the api return, no api return, no cams. I am sure there will be workarounds to handle that but using it as intended, there is not.

                                                                I think V1 will still has it's place and there are so many sites using it that I doubt that Chaturbate will be turning it off anytime soon. I have a note in Chaturbate right now asking if they have a planned end of life date on V1 as I use it all over the place.

                                                                That is my take on it for what it is worth and I guarantee that it is worth every cent you paid for it.

                                                                Edited in: I forgot to list what might be the biggest advantage although I did mention it in the OP. With V2 you can create a workable client side only solution. V1 did not really allow that because of the overhead involved in handling all the cams on every api call. Since you can limit the number of cams on V2 through the various passins you can create a client side solution that works. This moves a shitload of infrastructure and bandwidth off of your server and on to the client. This should result in lower costs and more efficient page delivery.

                                                                .
                                                                All cookies cleared!

                                                                Comment

                                                                • Colmike9
                                                                  (>^_^)b
                                                                  • Dec 2011
                                                                  • 7230

                                                                  #33
                                                                  Originally posted by sarettah
                                                                  exhibitionist= I am not sure what that will do, have not explored it yet,

                                                                  .
                                                                  I heard that those are accounts who just want to show off and not asking for tips. Seems weird lol.
                                                                  *I also heard it was for accounts that are also not age verified yet, which also seemed weird. Maybe the article I read is wrong, idk.
                                                                  Join the BEST cam affiliate program on the internet!
                                                                  I've referred over $1.7mil in spending this past year, you should join in.
                                                                  I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

                                                                  Comment

                                                                  • sarettah
                                                                    see you later, I'm gone
                                                                    • Oct 2002
                                                                    • 14297

                                                                    #34
                                                                    Originally posted by Colmike9
                                                                    I heard that those are accounts who just want to show off and not asking for tips. Seems weird lol.
                                                                    *I also heard it was for accounts that are also not age verified yet, which also seemed weird. Maybe the article I read is wrong, idk.
                                                                    Not sure but I did a test a few minutes ago. Set limit to 10 and set exhibitionist to true, got 1 record back.

                                                                    So, of all the thousands of cams on line at that time only 1 was marked exhibitionist so I don't know that the parameter is significant.

                                                                    .
                                                                    All cookies cleared!

                                                                    Comment

                                                                    • Paul&John
                                                                      Confirmed User
                                                                      • Aug 2005
                                                                      • 8643

                                                                      #35
                                                                      Originally posted by sarettah
                                                                      Another disadvantage showed itself yesterday. While I was making this thread, the api slowed down for some reason. This made all my demos break basically. I don't have to worry about that on the sites I am loading using V1. On those I load a database.
                                                                      I have a few cam sites using the API for each request so they use no database at all. Can such sites be theoretically faster then using a site + local sql database? Or only in cases when my server is really shitty slow or gets a ton of request and can't handle them properly?
                                                                      One of my best performing site in search engines gets data from the API alone, so no local caching etc.
                                                                      Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo!
                                                                      Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here

                                                                      Comment

                                                                      • redwhiteandblue
                                                                        Bollocks
                                                                        • Jun 2007
                                                                        • 2793

                                                                        #36
                                                                        Originally posted by sarettah
                                                                        Another disadvantage showed itself yesterday. While I was making this thread, the api slowed down for some reason. This made all my demos break basically. I don't have to worry about that on the sites I am loading using V1. On those I load a database. If the API does not return for me I just use the old set of cams until the API comes back. I am never without cams. That is not true if you are using V2 on every hit. On V2, you are basically presenting what is in the api return, no api return, no cams. I am sure there will be workarounds to handle that but using it as intended, there is not.
                                                                        .
                                                                        If you're using v2 to pull into a database, what IP do you use? The server IP?

                                                                        I notice a distinct delay on my webcam page using API v2, of about 2 seconds or more - and I'm only getting a list of 40 cams. I want to eliminate this by going to a database driven approach, only trouble is my site is aimed more at UK and European visitors so those are the cams I pull out of the API, but my server is in the US. So that's not ideal.
                                                                        Interserver unmanaged AMD Ryzen servers from $73.00

                                                                        Comment

                                                                        • sarettah
                                                                          see you later, I'm gone
                                                                          • Oct 2002
                                                                          • 14297

                                                                          #37
                                                                          Originally posted by Paul&John
                                                                          I have a few cam sites using the API for each request so they use no database at all. Can such sites be theoretically faster then using a site + local sql database? Or only in cases when my server is really shitty slow or gets a ton of request and can't handle them properly?
                                                                          One of my best performing site in search engines gets data from the API alone, so no local caching etc.
                                                                          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.

                                                                          .
                                                                          All cookies cleared!

                                                                          Comment

                                                                          • sarettah
                                                                            see you later, I'm gone
                                                                            • Oct 2002
                                                                            • 14297

                                                                            #38
                                                                            Originally posted by redwhiteandblue
                                                                            If you're using v2 to pull into a database, what IP do you use? The server IP?

                                                                            I notice a distinct delay on my webcam page using API v2, of about 2 seconds or more - and I'm only getting a list of 40 cams. I want to eliminate this by going to a database driven approach, only trouble is my site is aimed more at UK and European visitors so those are the cams I pull out of the API, but my server is in the US. So that's not ideal.

                                                                            I have not played with v2 on the server side so I am not sure what the best workaround would be yet. My gut instinct would be to hardcode my home ip in the client_ip field and use it that way but without playing with it some I could not give you a good answer.

                                                                            .
                                                                            All cookies cleared!

                                                                            Comment

                                                                            • k33n
                                                                              Confirmed User
                                                                              • Feb 2009
                                                                              • 201

                                                                              #39
                                                                              Originally posted by redwhiteandblue
                                                                              If you're using v2 to pull into a database, what IP do you use? The server IP?
                                                                              0.0.0.0 to avoid geo IP filter

                                                                              Comment

                                                                              • sarettah
                                                                                see you later, I'm gone
                                                                                • Oct 2002
                                                                                • 14297

                                                                                #40
                                                                                Originally posted by k33n
                                                                                0.0.0.0 to avoid geo IP filter
                                                                                That would appear to work. Thanks for that

                                                                                So, redwhiteandblue, there is your answer.

                                                                                .
                                                                                All cookies cleared!

                                                                                Comment

                                                                                • Paul&John
                                                                                  Confirmed User
                                                                                  • Aug 2005
                                                                                  • 8643

                                                                                  #41
                                                                                  Originally posted by sarettah
                                                                                  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..
                                                                                  Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo!
                                                                                  Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here

                                                                                  Comment

                                                                                  • sarettah
                                                                                    see you later, I'm gone
                                                                                    • Oct 2002
                                                                                    • 14297

                                                                                    #42
                                                                                    Originally posted by Paul&John
                                                                                    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).

                                                                                    .
                                                                                    All cookies cleared!

                                                                                    Comment

                                                                                    • Paul&John
                                                                                      Confirmed User
                                                                                      • Aug 2005
                                                                                      • 8643

                                                                                      #43
                                                                                      No-no, I'm talking about AWEs Video Promo API.. I havent checked CHBs API v2 yet
                                                                                      Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo!
                                                                                      Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here

                                                                                      Comment

                                                                                      • Shoplifter
                                                                                        Richest man in Babylon
                                                                                        • Jan 2002
                                                                                        • 5845

                                                                                        #44
                                                                                        @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.

                                                                                        Comment

                                                                                        • sarettah
                                                                                          see you later, I'm gone
                                                                                          • Oct 2002
                                                                                          • 14297

                                                                                          #45
                                                                                          Originally posted by Shoplifter
                                                                                          @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

                                                                                          .
                                                                                          All cookies cleared!

                                                                                          Comment

                                                                                          • sarettah
                                                                                            see you later, I'm gone
                                                                                            • Oct 2002
                                                                                            • 14297

                                                                                            #46
                                                                                            Originally posted by Paul&John
                                                                                            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

                                                                                            .
                                                                                            All cookies cleared!

                                                                                            Comment

                                                                                            • Shoplifter
                                                                                              Richest man in Babylon
                                                                                              • Jan 2002
                                                                                              • 5845

                                                                                              #47
                                                                                              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....

                                                                                              Comment

                                                                                              • sarettah
                                                                                                see you later, I'm gone
                                                                                                • Oct 2002
                                                                                                • 14297

                                                                                                #48
                                                                                                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.

                                                                                                .
                                                                                                All cookies cleared!

                                                                                                Comment

                                                                                                • sarettah
                                                                                                  see you later, I'm gone
                                                                                                  • Oct 2002
                                                                                                  • 14297

                                                                                                  #49
                                                                                                  Figured out the pagination today. Works pretty slick.

                                                                                                  .
                                                                                                  All cookies cleared!

                                                                                                  Comment

                                                                                                  • nikki99
                                                                                                    Supermodel
                                                                                                    • Nov 2004
                                                                                                    • 23087

                                                                                                    #50
                                                                                                    2 pages of cams
                                                                                                    SMC Revenue - Best Tgirl websites of the world now VR
                                                                                                    Non exclusive BIG Tranny/shemale Package for sale, full 2257 - hit me up skype: nikkimontero

                                                                                                    Comment

                                                                                                    Working...