Ejemplo n.º 1
0
<?php

//テスト対象のコード
require_once 'tweet_wrapper.php';
//debug
//アクセストークンを作成する
//最初に一度呼び出せば良い
TOATool::create_oauth("49650585-Jkfaz7X4v0SbEAkupLnczFOgLo3hL5asN7wGhy9Z4", "7gSHlpRoIiVSWlZYesyC7OZHLJunt7Vi8qWIYqKoo");
if (0) {
    //呼び出し
    $word = "一般意志";
    $results = search($word);
    //結果表示
    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);
Ejemplo n.º 2
0
require 'will_engine.php';
//パラメータを受け取る
if ($_SERVER["REQUEST_METHOD"] != "POST") {
    // GET ブラウザからHTMLページを要求された場合
    $word = $_GET['word'];
} else {
    // POST フォームからPOSTによって要求された場合
    $word = $_POST['word'];
}
//セッションスタート
session_start();
//認証OKなら
if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) {
    header('Location: ./clearsessions.php');
} else {
    TOATool::create_oauth($_SESSION['access_token']['oauth_token'], $_SESSION['access_token']['oauth_token_secret']);
}
//処理開始時間を保持
$start_time = time();
//分析処理
$res = analysis($word);
//処理終了時間を保持
$complete_time = time();
//経過時間を表示
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> \r\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>いるかの一般意志予報 | 一般意志2.0 実現システム α版</title> ";
?>


		<link rel="stylesheet" type="text/css" href="./js/jquery.jqplot.min.css" />
 <!--[if IE]><script language="javascript" type="text/javascript" src="./js/excanvas.min.js"></script><![endif]-->
  <script language="javascript" type="text/javascript" src="./js/jquery.min.js"></script> 
Ejemplo n.º 3
0
 static function create_oauth($access_token, $access_token_secret)
 {
     return self::$oauth = new TwitterOAuth(self::consumer_key, self::consumer_secret, $access_token, $access_token_secret);
 }