'; echo '


Drag and drop media sharing for App.net

Get started!





Built by @kosso

Powered by bli.ms and app.net
'; include_once('template/footer.php'); echo '
'; include_once('template/foot.php'); exit; } function getDelegateToken($access_token, $delegate_client_id){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://account.app.net/oauth/access_token"); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '.$access_token)); $params = array('grant_type' => 'delegate', 'delegate_client_id' => $delegate_client_id); $p = http_build_query($params); curl_setopt($ch, CURLOPT_POSTFIELDS, $p); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $data = curl_exec($ch); curl_close($ch); if(!$data){ echo 'error'; } //$response = json_decode($data); //logIt('APPNET REPLY getDelegateToken : '.$data); //echo '
';
	//echo $data;
	//echo '
'; return $data; } if(!isset($_SESSION[$app_name]['access_token'])){ if(isset($_GET['code'])){ $code = $_GET['code']; $details = Array(); $details['client_id'] = $client_id; $details['client_secret'] = $client_secret; $details['grant_type'] = 'authorization_code'; $details['redirect_uri'] = $redirect_uri; $details['code'] = $code; // get the access token $at = curly('https://account.app.net/oauth/access_token','','',$details); logIt('ACCESS TOKEN RESPONSE : '.$at); //echo $at; $adn = json_decode($at); //logIt('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); //logIt(print_r($adn->token->user, true)); //logIt('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); $user_json = json_encode($adn->token->user); $adn_access_token = $adn->access_token; $adn_username = $adn->username; $adn_user_id = $adn->user_id; //echo 'access_token:
';
		//print_r($adn);
		//echo '
'; //exit; /* curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer '.base64_encode($client_id.":".$client_secret), 'Identity-Delegate-Token: '.$delegate_token ) */ //$header = array('Authorization: Bearer '.$adn_access_token); //$details = Array(); //$details['grant_type'] = 'delegate'; //$details['delegate_client_id'] = $client_id; $app_object['client_id'] = $client_id; $app_json = json_encode($app_object); $del = json_decode(getDelegateToken($adn_access_token, $blims_client_id)); $_SESSION[$app_name]['access_token'] = $adn_access_token; $_SESSION[$app_name]['adn_username'] = $adn_username; $_SESSION[$app_name]['adn_user_id'] = $adn_user_id; $_SESSION[$app_name]['delegate_token'] = $del->delegate_token; // check user // get user_json //$uj = curly('https://api.app.net/users/'.$adn_user_id); //$user_json = json_decode($uj); //$app_json = json_decode($app_json); //$user_json = json_decode($adn->token->usern); //logIt($app_json); //logIt($user_json); //logIt('HMMMMM.... '); $ap = json_decode($app_json); //logIt($ap->client_id); $uj = json_decode($user_json); logIt($uj->id); // This will look up or create a new app_users user updateConnectingAppUser($ap, $uj); //logIt('AND THEN ??.... '); // update connecting user.... // store blims access_token to app_users. $sql = new $dbType("$host", "$user", "$pass", "$database"); $query = "UPDATE app_users SET blims_access_token = '".$adn_access_token."' WHERE app_user_id = ".$adn_user_id.";"; $sql->Query($query); $sql->Close(); //echo $adn_access_token.'
'; //echo 'delegate_token:
';
		//print_r($del);
		//echo '
'; logIt('bli.ms/cast logged in :'.$adn_username.' ['.$adn_access_token.']'); header('Location: '.$redirect_uri); exit; } else { showConnect(); //header('Location: /'); } } $in_reply_to = 0; if(isset($_GET['irt'])){ $in_reply_to = intval($_GET['irt']); } ?> BLIMSCAST

Hello @

log out


Enter the text for the post, then drag & drop a file [jpg, png, mp3, m4a, mp4, m4v or mov] on the dropzone to start the upload process and automatically post to app.net

new post text :
240


drop media file here
the upload and posting process will start as soon as you drop the file

please don't use this to upload files you don't own / didn't create