-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
33 lines (18 loc) · 812 Bytes
/
index.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
<?php
require_once("twitteroauth.php");
//oauth 1.0 authorization
$consumer = "Ex2iTrsp6bDF1j4Ru12aiDZYy";
$consemersecret = "C6HBPU8PMxYvGItW58xrStbZUgDffdSuiepfeqP7E0CdhbU7S6";
$accestoken = "914810761054101504-F9iVrvWl1B3iX1TSdOng3ROZ3u481Dd";
$accestokensecret = "gixpJMeoeddRBYP5jwXHc11db439RtmvofBvvl8VR99Zo";
// Mention your city woeid code to find top hashtags in twitters
$Woeid_country_id = 2295424; // chennai WOEID
//calling TwitterOauth
$twitter = new TwitterOAuth($consumer,$consemersecret,$accestoken,$accestokensecret);
// Twitter api url for hashtags in countrywise.
$tweets = $twitter->get('https://api.twitter.com/1.1/trends/place.json?id='.$Woeid_country_id);
$trends = $tweets[0]->trends;
foreach($trends as $trend){
echo $trend->name.'<br>';
}
?>