<commit_before><?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors',1);

// require_once('bots/Twitter_Bot.php');
require_once('bots/libs/weibo/WeiboOAuthV2.php');

$appKey = '1191803748';
$appSecret = '<KEY>';
$oauthKey = '<KEY>';

$connection = new WeiboOAuthV2($appKey,$appSecret,$oauthKey);

$redirect_uri = "http://www.heyqule.com/saywut/sandbox.php";

if(!empty($_REQUEST['code']))
{
    $keys = array();
    $keys['code'] = $_REQUEST['code'];
    $keys['redirect_uri'] = $redirect_uri;
    try {
        $token = $connection->getAccessToken( 'code', $keys ) ;
        print_r($token);
    } catch (OAuthException $e) {
    }
}
else
{
    $keys = array(
        'redirect_uri' => $redirect_uri
    );
    echo '<a href="'.$connection->getAuthorizeURL($redirect_uri).'">Login</a>';
}

?><commit_msg>Commit sandbox before major change..<commit_after><?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors',1);

require_once('config.php');
require_once('bots/Raw_Bot.php');
/*
require_once('bots/libs/weibo/WeiboOAuthV2.php');

$appKey = '1191803748';
$appSecret = '<KEY>';
$oauthKey = '<KEY>';

$connection = new WeiboOAuthV2($appKey,$appSecret,$oauthKey);

*/
echo '---------------------------------<br />';
echo 'LOAD TEST<br />';
echo '---------------------------------<br /><br />';

$post = new Post();

$post->load(205);

print_r($post);

echo '<br /><br />';
echo '----------------------------------<br />';
echo 'Save Test<br />';
echo '----------------------------------<br /><br />';
$post->title="123456";
$post->save();

$post2 = new Post();

$post2->load(205);

echo $post2->title;

$post2->title = '';
$post2->id = null;
$post2->save();

echo '<br /><br />';
echo '----------------------------------<br />';
echo 'Delete Test<br />';
echo '----------------------------------<br /><br />';

$post2->delete();

$post3 = new Post();
$post3->load(205);
echo "TTT".$post3->title;

$post2->save();

echo '<br /><br />';
echo '----------------------------------<br />';
echo 'Collection Test<br />';
echo '----------------------------------<br /><br />';

$post_collector = new Post_Collection();
$post_collector->addMetaWhere('hidden','=',1);
$posts = $post_collector->loadByQuery(0,10);

print_r($posts);

echo '<br /><br />';
echo '----------------------------------<br />';
echo 'Core::getBotKey:'.Core::getBotKey($GLOBALS['BOT_CONFIG'][1]).' - '.Core::getBotKey($GLOBALS['BOT_CONFIG'][12]).'<br />';
echo '-----------------------------------<br /><br />';


echo 'MEMORY:'.memory_get_usage();
?>
{'fraction_non_alphanumeric': 0.33053323593864137, 'fraction_numerical': 0.02154857560262966, 'mean_word_length': 2.56640625, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5161993', 'n_tokens_mistral': 962, 'n_tokens_neox': 919, 'n_words': 175}