function get_social_tags($id)
{
    $follower_array = array();
    $follow_array = get_follows($id);
    $merged_array = array();
    $tags = array();
    foreach (get_follows($id) as $follow) {
        $fame = get_tags($follow);
        if (0 < count($fame)) {
            foreach (get_followers($follow) as $follower) {
                $follower_array[] = $follower;
            }
            foreach ($follow_array as $element1) {
                foreach ($follower_array as $element2) {
                    if ($element1 == $element2) {
                        $merged_array[] = $element1;
                    }
                }
            }
            if (tag_shade_filter(count($merged_array), count($follow_array))) {
                foreach ($fame as $added_tag) {
                    $tags[] = $added_tag;
                }
            }
        }
    }
    $tags = array_unique($tags);
    return $tags;
}
Exemple #2
0
function get_follow_rate($user_id)
{
    $follows = get_follows($user_id);
    $followers = get_followers($user_id);
    $follower_cnt = 0;
    foreach ($follows as $follow) {
        if (array_key_exists($follow, $followers)) {
            $follower_cnt++;
        }
    }
    if (0 == count($follows)) {
        return 0;
    } else {
        return round($follower_cnt / count($follows) * 100);
    }
}
    //結果表示
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <title>Message</title> </head>";
    var_dump($results);
}
if (0) {
    //呼び出し
    $user_id = "49650585";
    $results = get_lists($user_id);
    //結果表示
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <title>Message</title> </head>";
    var_dump($results);
}
if (0) {
    //呼び出し
    $user_id = "49650585";
    $results = get_follows($user_id);
    //結果表示
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <title>Message</title> </head>";
    var_dump($results);
}
if (0) {
    //呼び出し
    $user_id = "49650585";
    //$user_id = "9449612"; //あずまん
    $results = get_followers($user_id);
    //結果表示
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <title>Message</title> </head>";
    var_dump($results);
}
//呼び出し
$screen_name = "tattyamm";
 public function set_follows()
 {
     self::$follows = get_follows(self::$user_id);
 }