• 30-09-2010, 01:17:14
    #1
    arkadaşlar bir script kodluyorum, twitter ile alakalı.

    sayfaya bilgileri print_r() ile yazdırdığımda ekrana şu geliyor

    stdClass Object (     [description] =>      [followers_count] => 330     [status] => stdClass Object         (             [retweeted] =>              [truncated] =>              [contributors] =>              [in_reply_to_status_id] =>              [place] =>              [coordinates] =>              [retweet_count] => 0             [source] => <a href="http://www.foly.net" rel="nofollow">Chatwit</a>             [favorited] =>              [geo] =>              [in_reply_to_user_id] =>              [id] => 25921242024             [in_reply_to_screen_name] =>              [text] => Foly testing             [created_at] => Wed Sep 29 22:05:48 +0000 2010         )      [following] =>      [time_zone] => Istanbul     [profile_background_color] => fff     [show_all_inline_media] =>      [friends_count] => 1773     [statuses_count] => 364     [profile_text_color] => 3C3940     [profile_use_background_image] => 1     [favourites_count] => 2     [contributors_enabled] =>      [profile_link_color] => 0099B9     [geo_enabled] =>      [notifications] =>      [profile_background_image_url] => http://a1.twimg.com/profile_backgrou...ed-texture.jpg     [protected] =>      [profile_sidebar_fill_color] => 95E8EC     [url] => http://www.erguner.net     [profile_image_url] => http://a2.twimg.com/profile_images/1123498198/11_normal.jpg     [name] => Turk Brain     [listed_count] => 14     [verified] =>      [profile_background_tile] =>      [id] => 49284438     [follow_request_sent] =>      [lang] => en     [utc_offset] => 7200     [created_at] => Sun Jun 21 10:16:25 +0000 2009     [profile_sidebar_border_color] => 5ED4DC     [location] => Teh internets     [screen_name] => TurkBrain )
    Ben buradan sadece en sondaki screen_name yazan yeri ekrana yazdırmak istiyorum.

    bunların ekrana geldiği kodlarım şöyle

    <?php
    /**
     * @file
     * User has successfully authenticated with Twitter. Access tokens saved to session and DB.
     */
    
    /* Load required lib files. */
    session_start();
    require_once('twitteroauth/twitteroauth.php');
    require_once('config.php');
    
    /* If access tokens are not available redirect to connect page. */
    if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) {
        header('Location: ./clearsessions.php');
    }
    /* Get user access tokens out of the session. */
    $access_token = $_SESSION['access_token'];
    
    /* Create a TwitterOauth object with consumer/user tokens. */
    $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
    
    /* If method is set change API call made. Test is called by default. */
    $content = $connection->get('account/verify_credentials');
    ?><pre><?
    print_r($content);
    ?></pre><?
    /* Some example calls */
    //$content = $connection->get('users/show', array('screen_name' => 'abraham'));
    //$connection->post('statuses/update', array('status' => 'Foly testing'));
    //$connection->post('statuses/destroy', array('id' => 5437877770));
    //$connection->post('friendships/create', array('id' => 9436992)));
    //$connection->post('friendships/destroy', array('id' => 9436992)));
    
    /* Include HTML to display on the page */
    include('html.inc');
    ?>
  • 30-09-2010, 01:22:26
    #2
    echo $content->screen_name;
    yapmadiniz mi ?
  • 30-09-2010, 01:39:36
    #3
    yapmıştım, bomboş sonuç verdi
  • 30-09-2010, 01:51:23
    #4
    hocam çıktıyı pre li bir şekilde yazdırır mısınız daha kolay yardımcı olabilirim
  • 30-09-2010, 10:00:01
    #5
    Kimlik doğrulama veya yönetimden onay bekliyor.
    $content->status->screen_name yapman gerekecek.
  • 30-09-2010, 10:42:16
    #6
    S4l1h adlı üyeden alıntı: mesajı görüntüle
    $content->status->screen_name yapman gerekecek.
    status bi array degil hocam ici bos oldugundan oyle gozukyor