Example #1
0
function analysis($word)
{
    $users = search($word);
    // ユーザーIDの配列
    $tweets = array();
    // ユーザーのツイート
    $lists = array();
    // ユーザーが登録されているリスト
    $follow_rates = array();
    // 相互フォロー率の配列
    // ユーザーごとのツイートとリストの集約
    foreach ($users as $user) {
        $user_id = $user['user_id'];
        $tweets = array_merge($tweets, get_tweets($user_id));
        $lists = array_merge($lists, get_lists($user_id));
        // 相互フォロー率の統計
        $rate = get_follow_rate($user_id);
        if (isset($follow_rates[$rate])) {
            $follow_rates[$rate]++;
        } else {
            $follow_rates[$rate] = 1;
        }
    }
    ksort($follow_rates, SORT_NUMERIC);
    // ツイート位置情報の統計
    $geos = get_geos($tweets);
    // ツイート日の統計
    $tweet_dates = get_date_for_tweets($tweets);
    // ツイート時間の統計
    $tweet_times = get_time_for_tweets($tweets);
    // ツイート長の統計
    $tweet_length = get_length_for_tweets($tweets);
    // ハッシュタグの統計
    $hash_tags = get_hash_tags($tweets);
    // ソート
    asort($lists);
    asort($hash_tags);
    $res = array("user" => $users, "tweet" => $tweets, "geo" => $geos, "list" => $lists, "tweet_date" => $tweet_dates, "tweet_time" => $tweet_times, "tweet_length" => $tweet_length, "hash_tag" => $hash_tags, "follow_rate" => $follow_rates);
    //    var_dump($res);
    return $res;
}
Example #2
0
    db_init();
    $f = fopen('dbc_out.dat', 'r');
    while (1) {
        $x = fgets($f);
        if (!$x) {
            break;
        }
        $n = sscanf($x, "%d", $resid);
        if ($n != 1) {
            echo "bad line: {$x}\n";
            continue;
        }
        $result = lookup_result($resid);
        if (!$result) {
            echo "no result {$resultid}\n";
            continue;
        }
        $wu = lookup_wu($result->workunitid);
        if ($wu) {
            echo "result has WU: {$resid}\n";
            continue;
        }
        echo "deleting {$resid}\n";
        // uncomment the following to actually delete
        die("edit script to enable deletion\n");
        //mysql_query("delete from result where id=$resid");
    }
}
get_lists();
join_lists();
delete_results();
Example #3
0
?>
 <?php 
echo _('to');
?>
 <span class="label"><?php 
echo number_format(get_saved_data('recipients'));
?>
 <?php 
echo _('subscribers');
?>
</span></em></p>
    	<p><em><?php 
echo _('Lists');
?>
: <?php 
echo get_lists();
?>
</em></p><br/>
    	
    	<div class="row-fluid">
    		<div class="span4">
		    	<div id="countries-container" style="min-height:300px;margin:20px 0 0 0;"></div>
	    	</div>
    		<div class="span8">
		    	<div id="container" style="margin-top: 50px;"></div>
		    </div>
	    </div>
    	
    	<br/>
    	<div class="row-fluid">
	    	<div class="span6">
Example #4
0
function get_all_lists($binding)
{
    return get_lists($binding, null);
}
    //結果表示
    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_tweets($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_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";