function get_friends($uid, $sess = null, $tu = null) { require_once WEB_ROOT . '../renren/renren.php'; require_once WEB_ROOT . '../renren/config.php'; if (!$sess) { $sess = TTGenid::getbyid($uid); } $pid = $sess['pid']; $sk = $sess['session_key']; $ren = new Renren(); $ren->api_key = RenrenConfig::$api_key; $ren->secret = RenrenConfig::$secret; $renren->session_key = $sk; $ren->init($sk); $ret = $ren->api_client->friends_getAppFriends(); if ($ret[0] > 1) { return implode(',', $ret); } return ''; }
$myloc = dirname(__FILE__); require_once $myloc . '/../../web/public/base.php'; require_once LIB_ROOT . 'DBModel.php'; $mail_body = "<pre>\n"; $gtt = TT::get_tt('genid', 0, 'slave'); $gttw = TT::get_tt('genid'); $now = time(); //$now -= 86400; $datestr = date('Y-m-d', $now); $weekday = date('N', $now); $day_starttime = strtotime($datestr); $day_endtime = $day_starttime + 86400; echo "date:{$datestr} \nweekday:{$weekday}\n"; $mail_body .= "date:{$datestr} \nweekday:{$weekday}\n"; require_once '../../web/renren/renren.php'; $ren = new Renren(); $ren->api_key = 'a32cb73bea154d2c9d40703b66dc9142'; $ren->secret = '023a6201a9b04955b1af79b1e9037c16'; $ren->init(); $dbconfig = array('host' => '127.0.0.1', 'username' => 'admin', 'password' => '123456', 'port' => '3307', 'charset' => 'utf8', 'dbname' => 'mall_stat'); $cmd = "mysql -u{$dbconfig['username']} -P{$dbconfig['port']} -h{$dbconfig['host']} "; if ($dbconfig['password']) { $cmd .= " -p'{$dbconfig['password']}'"; } $db = ServerConfig::connect_mysql($dbconfig); function getModel($name) { global $db; $m = new DBModel($name, false); $m->setDb($db); $m->useCache(false);
<?php require_once '../config.php'; require_once '../renren.php'; // $pid = $_REQUEST['xn_sig_user']; $session_key = $_REQUEST['xn_sig_session_key']; $gflg = $_REQUEST['glink']; $sess = TTGenid::getbypid($pid); $uid = $sess['id']; if ($session_key != $sess['session_key']) { $renren = new Renren(); $renren->api_key = RenrenConfig::$api_key; $renren->secret = RenrenConfig::$secret; $renren->session_key = $session_key; $renren->init($session_key); $rt = $renren->api_client->users_getLoggedInUser(); if ($rt['uid'] == $pid) { $sess['session_key'] = $session_key; TTGenid::update($sess, $sess['id']); } else { header('Location: ' . RenrenConfig::$canvas_url); } } $tu = new TTUser($uid); $iid = $tu->getdid('installbar', TT::OTHER_GROUP); $barobj = $tu->getbyid($iid); $install_bar = true; if ($barobj == null || $barobj['email'] == null) { $install_bar = true; } else {
if (array_key_exists($k, $value['invite']) && !$new) { unset($ids[$k]); } else { $value['invite'][$k] = $v; } } $_REQUEST['ids'] = $ids; } if (!$gid) { $gid = 0; } $_REQUEST['geted'] = array(0); if ($pid) { $tw->put($value); $tw->put($_REQUEST); TTLog::record(array('m' => 'pub_invite', 'tm' => $_SERVER['REQUEST_TIME'], 'u' => $sess['id'], 'sp2' => $linkid, 'sp1' => $gid)); } $sessionK = $_REQUEST['sessionK']; $renren = new Renren(); $renren->session_key = $sessionK; $renren->api_key = RenrenConfig::$api_key; $renren->secret = RenrenConfig::$secret; $renren->init($sessionK); $noti = '<xn:name uid="' . $pid . '" linked="true"/><a href="' . RenrenConfig::$canvas_url . '">正在玩购物天堂,邀请你去帮他装货、卸货,顺便帮他抢几个客人</a>'; $idstr = ''; foreach ($_REQUEST['ids'] as $k => $id) { $idstr .= $k . ','; } $ids = substr($ids, 0, strlen($idstr) - 1); $r = $renren->api_client->notifications_send($idstr, $noti); header('Location: ' . RenrenConfig::$canvas_url . '?f=invite¬i=' . $r['result']);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, $this->_cookiefile); $contents = curl_exec($ch); curl_close($ch); //print_r($contents); } function setStatus($status) { $post_fields['content'] = $status; $post_fields['hostid'] = '222785680'; $post_fields['channel'] = 'renren'; $send_url = 'http://shell.renren.com/222785680/status'; $ch = curl_init($send_url); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5'); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_REFERER, 'http://shell.renren.com/ajaxproxy.htm'); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields); curl_setopt($ch, CURLOPT_COOKIEFILE, $this->_cookiefile); $contents = curl_exec($ch); curl_close($ch); //$contents = json_decode($contents,TRUE); //print_r($contents); } } $renrenapi = new Renren('', ''); $renrenapi->login(); $renrenapi->getHomePage(); $renrenapi->setStatus('这是个测试');
<?php $myloc = dirname(__FILE__); require_once $myloc . '/bg/base.php'; require_once LIB_ROOT . 'ModelFactory.php'; require_once LIB_ROOT . 'AutoIncIdGenerator.php'; require_once LIB_ROOT . 'renren/renren.php'; require_once $myloc . '/config.php'; $renren = new Renren(); $renren->api_key = RenrenConfig::$api_key; $renren->secret = RenrenConfig::$secret; $renren->init(); CrabTools::myprint($renren, RES_DATA_ROOT . "/renren"); $platform_id = "renren" . $renren->user; $user_id = AutoIncIdGenerator::genid($platform_id); $order_db = ServerConfig::getdb_by_userid(0); $db = ServerConfig::getdb_by_userid($user_id); $ua = ModelFactory::UserAccount($db); $order = ModelFactory::Order($order_db); if (!$ua->find($user_id)) { // Logger::error("not existed user: "******"message" => 'not existed user')); exit; } $order2type = array(1 => array("gem" => 0, "money" => 100000), 2 => array("gem" => 0, "money" => 205000), 3 => array("gem" => 0, "money" => 515000), 4 => array("gem" => 0, "money" => 1035000), 5 => array("gem" => 0, "money" => 2080000), 6 => array("gem" => 0, "money" => 5150000), 7 => array("gem" => 1000, "money" => 0), 8 => array("gem" => 2050, "money" => 0), 9 => array("gem" => 5150, "money" => 0), 10 => array("gem" => 10350, "money" => 0), 11 => array("gem" => 20800, "money" => 0), 12 => array("gem" => 51500, "money" => 0)); $amount = $_POST['amount']; $order_data = $order2type[$_POST['order_type']]; if ($amount < 10 || $amount > 500) { print json_encode(array("message" => 'error amount')); exit; }