Pada file common/twitter.php, cari
function twitter_update() {
menambahkan coding dibawah ini SEBELUM if ($status) {
$callback_key = false;
if (mb_strlen($status, ‘utf-8′) > 140) {
$reply_to_id = null;
if (is_numeric((string) $_POST['in_reply_to_id'])) {
$reply_to_id = (string) $_POST['in_reply_to_id'];
}
$response = post_twtmore_tweet(user_current_username(), $status, $reply_to_id);
if (!$response) {
theme(‘error’, "<h2>Long tweet error</h2><p>An unexpected error occured while posting to twtmore. Please try again.</p><hr>");
twitter_refresh($_POST['from'] ? $_POST['from'] : ”);
return;
}
$tatus = $response->tweet->short_content;
$callback_key = $response->callback_key;
}
masih di dalam funtion yg sama, tambahkan coding di bawah ini SESUDAH $b = twitter_process($request, $post_data);
if ($callback_key) {
post_twtmore_callback($callback_key, $b->id_str);
}
kemudian tambahkan junga coding functions di dalam file common/twitter.php tersebut, terserah di taro di bagian mana, asal tidak di dalam function yg lain, taruh saja di bagian paling bawah sebelum tanda ?>
// twtmore api key
define(‘TWTMORE_API_KEY’, ‘ISI_DENGAN_API_TWTMORE_KAMU’);function post_twtmore_tweet($username, $tweet, $reply_to_tweet_id = null)
{// Formulate the request
$request = array(
‘apikey’ => TWTMORE_API_KEY,
‘user’ => $username,
‘tweet’ => $tweet
);// If reply
if ($reply_to_tweet_id)
{
$request['reply_to_tweet'] = $reply_to_tweet_id;
}// Create CURL
$url = ‘http://api.twtmore.com/v3/shorten’;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);// Execute CURL
$response = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);// Close CURL
curl_close($ch);// Check we have a % 200 HTTP status code, and the JSON decodes ok
if ($code == 200 && ($resp = json_decode($response)))
{
return $resp;
}// There was an error
return false;
}function post_twtmore_callback($callback_key, $twitter_id)
{
$request = array(
‘apikey’ => TWTMORE_API_KEY,
‘key’ => $callback_key,
‘status_id’ => $twitter_id
);$url = ‘http://api.twtmore.com/v3/callback’;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
}
Do not forget to visit & use Twitter Client from us at the address www.imorv.com
Filed under: Dabr, Twitter Ditandai: | Dabr, Mobile Twitter Client, Tweet Longer, Twitter, Twitter Client, twtmore
Masbro mau nanya nie, knapa ya bit.ly didabrku gak berfungsi http://www.mytuit.tk
Gajelas, lu udeh coba blm ni? jgn2 cuma copas doank …payahhh
Parse error: syntax error, unexpected T_STRING in /home/rajaknet/public_html/sukasuka/common/twitter.php on line 876
Hahaha copas,,, sotoy….
Baca ampe abis, disitu ad TC w yg udah jadi dgn fitur2….
Kalo gag jelas, brarti ente yg gag jelas…
gatau maksudnya apa._.