View Single Post
Old 11-25-2013, 04:22 AM  
boyrev
Confirmed User
 
boyrev's Avatar
 
Industry Role:
Join Date: Sep 2010
Posts: 44
Here, some code to assist lethargy

PHP Code:
<?php

// notes: $username - your mysql username
//        $password - your mysql password
//        $db - name of your database 

$handle_db1 mysql_connect("localhost",$username,$password,true) or die(mysql_error()); 
mysql_select_db($db,$handle_db1) or die(mysql_error());


// notes: UUUUUUUU is your chaturbate username
//        PPPPPPPP is your chaturbate encoded password (you can get this from the cb alert emails)
 
$g='http://chaturbate.com/accounts/autologin/?username=UUUUUUUU&password=PPPPPPPP%3D&next=%2Faffiliates%2Fapi%2Fonlinerooms%2F%3Fformat=json%26wm=lmzR4';

$f file_get_contents($g);

if(!
function_exists('json_decode')) die('Your host does not support json');
$feed json_decode($f);

$rs mysql_query("truncate table datain");
for(
$i=0$i<count($feed); $i++){
    
$sql = array();
    foreach(
$feed[$i] as $key => $value){
        
$sql[] = (is_numeric($value)) ? "`$key` = $value\n" "`$key` = '" mysql_real_escape_string($value) . "'\n";
    }
    
$sqlclause implode(",",$sql);
    
$rs mysql_query("INSERT INTO datain SET $sqlclause");
}


/*
Notes:

Table structure for datain:

CREATE TABLE `datain` (
`username` VARCHAR( 64 ) NOT NULL ,
`seconds_online` INT( 10 ) NOT NULL ,
`spoken_languages` VARCHAR( 128 ) NOT NULL ,
`display_name` VARCHAR( 64 ) NOT NULL ,
`num_users` INT( 5 ) NOT NULL ,
`chat_room_url` VARCHAR( 128 ) NOT NULL ,
`gender` VARCHAR( 1 ) NOT NULL ,
`age` INT( 2 ) NOT NULL ,
`recorded` VARCHAR( 16 ) NOT NULL ,
`current_show` VARCHAR( 16 ) NOT NULL ,
`iframe_embed_revshare` VARCHAR( 256 ) NOT NULL ,
`birthday` DATE NOT NULL ,
`image_url` VARCHAR( 128 ) NOT NULL ,
`location` VARCHAR( 128 ) NOT NULL ,
`block_from_states` VARCHAR( 256 ) NOT NULL ,
`block_from_countries` VARCHAR( 256 ) NOT NULL ,
`iframe_embed` VARCHAR( 256 ) NOT NULL ,
`chat_room_url_revshare` VARCHAR( 128 ) NOT NULL
) ENGINE = InnoDB;

*/
boyrev is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote