Show facebook, twitter status updates in PHP

in my webpage, I want to show facebook and twitter status updates of my account, as one. Means show statuses from twitter and fb date wise. As shown below:

T: twitter status update 1
T: twitter status update 2
F: Facebook status update 3
T: twitter status update 4
F: Facebook status update 5

I am using wordpress for my website, is there any such plugin in wordpress? or any code using which I can do it manually in php?

Read More

Please check and advise.

Thanks!

Related posts

Leave a Reply

1 comment

  1. Here is php code for twitter update/status.

        $body = array(
            'status'=>'YOURMESSAGE'
        );
        $url = "https://api.twitter.com/1.1/statuses/update.json";
        $oauth_access_token = "YOURVALUE";
        $oauth_access_token_secret = "YOURVALUE";
        $consumer_key = "YOURVALUE";
        $consumer_secret = "YOURVALUE";
    
        $oauth = array( 'oauth_consumer_key' => $consumer_key,
            'oauth_nonce' => time(),
            'oauth_signature_method' => 'HMAC-SHA1',
            'oauth_token' => $oauth_access_token,
            'oauth_timestamp' => time(),
            'oauth_version' => '1.0');
    
        $base_info = buildBaseString($url, 'POST', $oauth);
        $composite_key = rawurlencode($consumer_secret) . '&' . rawurlencode($oauth_access_token_secret);
        $oauth_signature = base64_encode(hash_hmac('sha1', $base_info, $composite_key, true));
        $oauth['oauth_signature'] = $oauth_signature;
        $header = array(buildAuthorizationHeader($oauth), 'Expect:');
        $options = array( CURLOPT_HTTPHEADER => $header,
            CURLOPT_POSTFIELDS => $body,
            CURLOPT_HEADER => false,
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => false);
    
        $feed = curl_init();
        curl_setopt_array($feed, $options);
        $json = curl_exec($feed);
        curl_close($feed);
    
        $result_data = json_decode($json);
    
    function buildBaseString($baseURI, $method, $params) {
        $r = array();
        ksort($params);
        foreach($params as $key=>$value){
            $r[] = "$key=" . rawurlencode($value);
        }
        return $method."&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $r));
    }
    
    function buildAuthorizationHeader($oauth) {
        $r = 'Authorization: OAuth ';
        $values = array();
        foreach($oauth as $key=>$value)
            $values[] = "$key="" . rawurlencode($value) . """;
        $r .= implode(', ', $values);
        return $r;
    }
    

    `