-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscience.php
161 lines (105 loc) · 4.3 KB
/
science.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE html>
<!--[if IE 8 ]><html class="no-js oldie ie8" lang="en"> <![endif]-->
<!--[if IE 9 ]><html class="no-js oldie ie9" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html class="no-js" lang="en"> <!--<![endif]-->
<head>
<!--- basic page needs
================================================== -->
<meta charset="utf-8">
<title>Abstract</title>
<meta name="description" content="">
<meta name="author" content="">
<!-- mobile specific metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- CSS
================================================== -->
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/vendor.css">
<link rel="stylesheet" href="css/main.css">
<!-- script
================================================== -->
<script src="js/modernizr.js"></script>
<script src="js/pace.min.js"></script>
<!-- favicons
================================================== -->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body id="top">
<!-- header
================================================== -->
<header class="short-header">
<div class="gradient-block"></div>
<div class="row header-content">
<div class="logo">
<a href="index.html">Author</a>
</div>
<nav id="main-nav-wrap">
<ul class="main-navigation sf-menu">
<li><a href="index.php" title="">Entertainment</a></li>
<li><a href="News.php" title="">News</a></li>
<li><a href="sports.php" title="">Sports</a></li>
<li class="current"><a href="science.php" title="">Science</a></li>
</ul>
</nav> <!-- end main-nav-wrap -->
</div>
</header> <!-- end header -->
<!-- masonry
================================================== -->
<section id="bricks">
<div class="row masonry">
<!-- brick-wrapper -->
<div class="bricks-wrapper">
<div class="grid-sizer"></div>
<?php
require_once('TwitterAPIExchange.php');
error_reporting(0);
$settings = array(
'oauth_access_token' => "",
'oauth_access_token_secret' => "",
'consumer_key' => "",
'consumer_secret' => ""
);
$url = "https://api.twitter.com/1.1/search/tweets.json";
$requestMethod = "GET";
$getfield = '?q=science&src=typd&count=20';
$twitter =new TwitterAPIExchange($settings);
$string = json_decode($twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest(),$assoc = TRUE);
/*if($string["errors"][0]["message"] != "") {echo "<h3>Sorry, there was a problem.</h3><p>Twitter returned the following error message:</p><p><em>".$string[errors][0]["message"]."</em></p>";exit();}*/
foreach($string as $item)
{
foreach($item as $items){
echo '
<article class="brick entry format-standard animate-this">
<div class="entry-thumb">
</div>
<div class="entry-text">
<div class="entry-header">
<div class="entry-meta">
</div>
<h1 class="entry-title">Tweeted by: '.$items['user']['name'].'</h1>
<h5>Screen Name:'.$items['user']['screen_name'].'</h5>
<h5 >Followers:'.$items['user']['followers_count'].'</h5>
<h5>Friends:'. $items['user']['friends_count'].'</h5>
<h5>Listed:'.$items['user']['listed_count'].'</h5>
</div>
<div class="entry-excerpt">
'. $items['text'].'
</div>
</div>
</article>';
}}?>
</div> <!-- end brick-wrapper -->
</div> <!-- end row -->
</section> <!-- end bricks -->
<!-- Java Script
================================================== -->
<script src="js/jquery-2.1.3.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/jquery.appear.js"></script>
<script src="js/main.js"></script>
</body>
</html>