Example #1
0
<?php

header('Content-Type:text/html;charset=utf-8');
session_start();
include_once 'oauth.php';
// include_once( 'config'.rand(1,3).'.php' );
include_once 'config.php';
$c = new WeiboClient(WB_AKEY, WB_SKEY, $_SESSION['last_key']['oauth_token'], $_SESSION['last_key']['oauth_token_secret']);
// print_r($_FILES["my_uploaded_file"]);
if (isset($_FILES['my_uploaded_file']['tmp_name'])) {
    $msg1 = $c->upload(date("l dS \\of F Y h:i:s A"), $_FILES['my_uploaded_file']['tmp_name']);
    $msg2 = $c->user_timeline(1, 1);
    if (is_array($msg2)) {
        foreach ($msg2 as $item2) {
            echo $item2['original_pic'];
        }
    }
}
?>



Example #2
0
            $isQqTrue = false;
            break;
    }
    if ($isQqTrue) {
        if (!empty($qq_tweets['data']['info'][0]['image'][0])) {
            $imgurl = $qq_tweets['data']['info'][0]['image'][0] . '/2000';
        }
        $ret = $sina_c->postTosina('- ' . $qq_tweets['data']['info'][0]['origtext'], $imgurl);
        if (!empty($ret['user'])) {
            memcache_set($mmc, "qq_last_update", $qq_tweets['data']['info'][0]['timestamp']);
        }
    }
}
//同步新浪微博到腾讯微博
if (TOQQ == 0) {
    $sina_tweets = $sina_c->user_timeline(1, 1);
    if (!empty($sina_tweets['error_code'])) {
        exit;
    } else {
        $isSinaTrue = true;
        switch ($isSinaTrue) {
            case strtotime($sina_tweets[0]['created_at']) <= $sina_last_update:
                $isSinaTrue = false;
                break;
            case !empty($sina_tweets[0]['retweeted_status']):
                //判断是否转发、评论、对话
                $isSinaTrue = false;
                break;
            case preg_match('/^-/', trim($sina_tweets[0]['text'])):
                // 以 "-" 开关的微博不同步
                $isSinaTrue = false;