Need help with Chaturbate API coding.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • linkhouse
    Registered User
    • Jun 2014
    • 68

    #46
    Version 2.1, is there a way to change the _banner display to a Male or Shemale? Now it only shows top viewer.

    Comment

    • linkhouse
      Registered User
      • Jun 2014
      • 68

      #47
      Originally posted by linkhouse
      Version 2.1, is there a way to change the _banner display to a Male or Shemale? Now it only shows top viewer.
      I think I solved the problem, I put in: if ( $cam->gender == s )

      code:

      function tpl_banner() {

      $cams = new SimpleXMLElement(FLATFILE, null, true);
      $count = 0;


      foreach( $cams as $cam ){

      if ( $cam->gender == s ) {
      if ( $count == 0 )

      {

      Comment

      • Freedoom
        Confirmed User
        • Feb 2006
        • 2811

        #48
        Originally posted by linkhouse
        Version 2.1, is there a way to change the _banner display to a Male or Shemale? Now it only shows top viewer.
        you fix the problem with the cron in 2.1?
        List Of Sex Cams

        Comment

        • linkhouse
          Registered User
          • Jun 2014
          • 68

          #49
          Originally posted by Freedoom
          you fix the problem with the cron in 2.1?
          Yes. Download the latest cron.php file from the v2.1

          And check that settings.php have the right paths

          For exempel:

          define ( 'BASEPATH', '/home/xxx/public_html/xxx .com' );
          define ( 'FLATFILE', BASEPATH . '/includes/data/feed.xml');

          Comment

          • Freedoom
            Confirmed User
            • Feb 2006
            • 2811

            #50
            Originally posted by linkhouse
            Yes. Download the latest cron.php file from the v2.1

            And check that settings.php have the right paths

            For exempel:

            define ( 'BASEPATH', '/home/xxx/public_html/xxx .com' );
            define ( 'FLATFILE', BASEPATH . '/includes/data/feed.xml');
            Yes I did.
            But the new settings.php in V2.1 doesn't have that base path.

            define ( 'BASEPATH', getcwd() );
            define ( 'FLATFILE', BASEPATH . '/includes/data/feed.xml');
            If I removed the includes/ it doesn't work.
            The only way the site is updated is only if I turn the cron to false
            List Of Sex Cams

            Comment

            • adulttemps
              Confirmed User
              • May 2002
              • 320

              #51
              do you have an actual cron job setup to run cron.php however often you want to update?
              Hillipino Money with Cams

              Comment

              • Freedoom
                Confirmed User
                • Feb 2006
                • 2811

                #52
                Originally posted by adulttemps
                do you have an actual cron job setup to run cron.php however often you want to update?
                Yes every 30 minutes. Also I run the cron.php by myself and it doesn't update
                List Of Sex Cams

                Comment

                • Panty Snatcher
                  eat a peach for Hours
                  • Aug 2013
                  • 540

                  #53
                  30 minutes is too long

                  try every 3 - 5 minutes

                  Comment

                  • Barry-xlovecam
                    It's 42
                    • Jun 2010
                    • 18083

                    #54
                    If you want to just cache the current XML of online models ...

                    PHP Code:
                    <?php
                    //debugging comment out when done
                    error_reporting(E_ALL);
                    ini_set('display_errors', '1');
                    //cache the working XML file locally
                    
                    $sFileName = './name.xml';
                    $iCurrentTime = time();
                    $iFiletime = filemtime($sFileName);
                             if ($iFiletime < $iCurrentTime - 120) {
                                 $data = file_get_contents('http://URL_here');
                     $fp = fopen($sFileName, 'w+'); 
                                 fwrite($fp, $data); 
                                 fclose($fp); 
                             }    
                    ///load cached xml file
                    
                    $xml  = simplexml_load_file("name.xml");
                    
                    //You do the rest :OP{...}
                    
                    ?>
                    Works with PHP 5 untested with PHP 7*

                    Comment

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

                      #55
                      Originally posted by Freedoom
                      Yes every 30 minutes. Also I run the cron.php by myself and it doesn't update
                      If it is not updating from both cron and running from the browser then you probably have a permissions problem with the folder that the xml file is being written to.

                      If it will write when you run cron from the browser then make sure to delete the file before you try to update it from the cron. If the file was created from a run from the browser then the run from cron might not be able to delete the file created from the run from browser, again because of permissions issues.

                      .
                      All cookies cleared!

                      Comment

                      • linkhouse
                        Registered User
                        • Jun 2014
                        • 68

                        #56
                        Bonga API script. I have problem. The Male cams are not showing. All other works ok. But no cams for Male is working. The XML file do contains Male cams.

                        Comment

                        • linkhouse
                          Registered User
                          • Jun 2014
                          • 68

                          #57
                          Originally posted by Freedoom
                          Yes every 30 minutes. Also I run the cron.php by myself and it doesn't update
                          Check your error log file after you try manual running cron.php. there you can see if there is a problem.

                          Comment

                          • adulttemps
                            Confirmed User
                            • May 2002
                            • 320

                            #58
                            updated the bonga script, had a typo on the male category
                            Hillipino Money with Cams

                            Comment

                            • linkhouse
                              Registered User
                              • Jun 2014
                              • 68

                              #59
                              Originally posted by adulttemps
                              updated the bonga script, had a typo on the male category
                              Thank you

                              Comment

                              • k33n
                                Confirmed User
                                • Feb 2009
                                • 201

                                #60
                                Originally posted by adulttemps
                                @keen - checkout v2.1 I changed up the directory structure a bit but the functions are pretty much the same.

                                Just keep in mind some of the models put fake ages so the categories wont be 100% accurate.

                                https://github.com/hillipino/Chaturbate-API
                                Thank you man! It's working great

                                Comment

                                Working...