-
Notifications
You must be signed in to change notification settings - Fork 0
/
Trend_India.php
66 lines (55 loc) · 2.03 KB
/
Trend_India.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?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) {
str = (str + '').toString();
return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A');
}
function pass(id){
parent.cht.location.replace('tweet_chrt.php?link='+rawurlencode(document.getElementById(id).value));
parent.ts.location.replace('tweet_stat.php?link='+rawurlencode(document.getElementById(id).value));
}
</script>
</head><body style=\"height: 100%; margin: 0px;\">";
echo '<table width=100%>
<tr>
<td><div style="background-image: url("Images/txtr2.jpg");"><a style="font-size: large;font-family: moltor"> Trending in India : </a></div></td>
</tr>';
$cnt = 1;
foreach ($results_India as $resultw) {
foreach($resultw->trends as $result){
echo '<tr><td><button type="button" id="btn_'.$cnt.'" onclick="pass(this.id);" value="'.rawurldecode($result->name).'">'.rawurldecode($result->name).'</button></td></tr>';
$cnt += 1;
}
}
echo '</table></body></html>';
}
catch(Exception $e) {
echo 'Message: ' .$e->getMessage();
}