예제 #1
0
 public function testNoErrortrnd()
 {
     $nw = new NewWorld();
     $toa = $nw->GetAPICon();
     $query = array("id" => 1);
     $this->assertArrayNotHasKey('error', $nw->GetTrendPlace($toa, $query));
 }
예제 #2
0
 public function testSub()
 {
     $nw = new NewWorld();
     $this->assertEquals(1, $nw->Sub(3, 2));
 }
예제 #3
0
<?php

/**
 * Created by PhpStorm.
 * User: kongu
 * Date: 02-Aug-15
 * Time: 12:05 AM
 */
require_once getcwd() . '/twitteroauth/autoload.php';
require_once getcwd() . '/phpInsight-master/autoload.php';
require_once getcwd() . '/NewWorld.php';
use Abraham\TwitterOAuth\TwitterOAuth;
#use NewWorld;
try {
    $sentiment = new \PHPInsight\Sentiment();
    $nw = new NewWorld();
    $toa = $nw->GetAPICon();
    $woeid_India = 23424848;
    $query_India = array("id" => $woeid_India);
    $results_India = $nw->GetTrendPlace($toa, $query_India);
    echo '<html><head>
            <style>
                @font-face {
                    font-family: moltor;
                    src: url(fonts/Moltorv2i.ttf);
                }
            </style>
            <script type="text/javascript">';
    echo "function rawurlencode(str) {\n                str = (str + '').toString();\n                return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/\\*/g, '%2A');\n            }\n            function pass(id){\n                parent.cht.location.replace('tweet_chrt.php?link='+rawurlencode(document.getElementById(id).value));\n                parent.ts.location.replace('tweet_stat.php?link='+rawurlencode(document.getElementById(id).value));\n            }\n            </script>\n            </head><body style=\"height: 100%; margin: 0px;\">";
    echo '<table width=100%>
            <tr>
예제 #4
0
<?php

/**
 * Created by PhpStorm.
 * User: kongu
 * Date: 01-Aug-15
 * Time: 11:36 PM
 */
require_once getcwd() . '/twitteroauth/autoload.php';
require_once getcwd() . '/phpInsight-master/autoload.php';
require_once getcwd() . '/NewWorld.php';
use Abraham\TwitterOAuth\TwitterOAuth;
#use NewWorld;
try {
    $sentiment = new \PHPInsight\Sentiment();
    $nw = new NewWorld();
    $toa = $nw->GetAPICon();
    $woeid_World = 23424977;
    $query_World = array("id" => $woeid_World);
    $results_world = $nw->GetTrendPlace($toa, $query_World);
    echo '<html><head>
            <style>
                @font-face {
                    font-family: moltor;
                    src: url(fonts/Moltorv2i.ttf);
                }
            </style>
            <script type="text/javascript">';
    echo "function rawurlencode(str) {\n                str = (str + '').toString();\n                return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\\(/g, '%28').replace(/\\)/g, '%29').replace(/\\*/g, '%2A');\n            }\n            function pass(id){\n                parent.cht.location.replace('tweet_chrt.php?link='+rawurlencode(document.getElementById(id).value));\n                parent.ts.location.replace('tweet_stat.php?link='+rawurlencode(document.getElementById(id).value));\n            }\n            </script>\n            </head><body style=\"height: 100%; margin: 0px;\">";
    echo '<table width=100%>
            <tr>
예제 #5
0
<?php

/**
 * Created by PhpStorm.
 * User: kongu
 * Date: 01-Aug-15
 * Time: 1:39 PM
 */
require_once getcwd() . '/twitteroauth/autoload.php';
require_once getcwd() . '/phpInsight-master/autoload.php';
require_once getcwd() . '/NewWorld.php';
use Abraham\TwitterOAuth\TwitterOAuth;
#use NewWorld;
try {
    $sentiment = new \PHPInsight\Sentiment();
    $nw = new NewWorld();
    $toa = $nw->GetAPICon();
    $woeid_World = 1;
    $woeid_India = 23424848;
    $woeid_USA = 23424977;
    $query_World = array("id" => $woeid_World);
    $query_India = array("id" => $woeid_India);
    $query_USA = array("id" => $woeid_USA);
    $results_world = $nw->GetTrendPlace($toa, $query_World);
    $results_India = $nw->GetTrendPlace($toa, $query_India);
    $results_USA = $nw->GetTrendPlace($toa, $query_USA);
    #echo json_encode($results_world);
    #echo gettype($results_world).'<br><br>';
    echo '<html><head></head><body>';
    echo '<table width=100%>
            <tr>