forked from tathagata/spurious
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
144 lines (130 loc) · 5.5 KB
/
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
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
<html>
<head>
<meta name = "viewport" content width = device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;">
<link rel="stylesheet" type="text/css" media="all" href="http://trina.ch/berlinhackfest/curious/demo.css" />
<link rev="canonical" type="text/html" href="http://trina.ch/berlinhackfest/curious" />
<script type="text/javascript" src="js/jquery.js"></script>
<script src="http://code.google.com/apis/gears/gears_init.js" type="text/javascript" charset="utf-8"></script>
<script src="js/geo.js" type="text/javascript" charset="utf-8"></script>
<script src="js/mapping.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="https://www.google.com/jsapi?key=ABQIAAAAEuwUqFVvNIBr6HOzKB5bChSeo-zD9t-xtZqO38hYJbYqntkDphTN7cSL-plbi9qxYVTuyFpMTyatQA" type="text/javascript"></script>
</head>
<body onLoad="initialize_map();initialize()">
<div id="header">
<h1>I'm curious about...</h1>
<ul>
<li>add event</li>
<li>find event</li>
</ul>
</div>
<?php
include 'lib/EpiCurl.php';
include 'lib/EpiOAuth.php';
include 'lib/EpiTwitter.php';
include 'lib/secret.php';
$twitterObj = new EpiTwitter('dwP6Jmpcmu9rlh0K47qaA','DLUQwbCeVJUASw5ASoEoplUr8sxkoQhhNgxxhqZfs');
//$oauth_token = $_GET['oauth_token'];
if(isset($_GET['oauth_token']) || (isset($_COOKIE['oauth_token']) && isset($_COOKIE['oauth_token_secret'])))
{
// user accepted access
if( !isset($_COOKIE['oauth_token']) || !isset($_COOKIE['oauth_token_secret']) )
{
// user comes from twitter
$twitterObj->setToken($_GET['oauth_token']);
$token = $twitterObj->getAccessToken();
setcookie('oauth_token', $token->oauth_token);
setcookie('oauth_token_secret', $token->oauth_token_secret);
$twitterObj->setToken($token->oauth_token, $token->oauth_token_secret);
}
else
{
// user switched pages and came back or got here directly, stilled logged in
$twitterObj->setToken($_COOKIE['oauth_token'],$_COOKIE['oauth_token_secret']);
}
$user= $twitterObj->get_accountVerify_credentials();
echo "
<html>
<head>
<meta name = \"viewport\" content = \"width = device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;\">
<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"http://trina.ch/berlinhackfest/curious/demo.css\" />
<link rev=\"canonical\" type=\"text/html\" href=\"http://trina.ch/berlinhackfest/curious\" />
<script type=\"text/javascript\" src=\"js/jquery.js\"></script>
<script src=\"http://code.google.com/apis/gears/gears_init.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"js/geo.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"js/mapping.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script type=\"text/javascript\" src=\"http://maps.google.com/maps/api/js?sensor=false\"></script>
<script src=\"https://www.google.com/jsapi?key=ABQIAAAAEuwUqFVvNIBr6HOzKB5bChSeo-zD9t-xtZqO38hYJbYqntkDphTN7cSL-plbi9qxYVTuyFpMTyatQA\" type=\"text/javascript\"></script>
<script type=\"text/javascript\" src=\"http://tweet-it.st.pongsocket.com/tweet-it.js\"></script>
<script type='text/javascript' src='http://trina.ch/wp-content/themes/trina/js/switch.js'></script>
</head>
<body onLoad=\"initialize_map();initialize()\">
<div id=\"header\">
<h1>I'm curious about...</h1>
<ul>
<li>add event</li>
<li>find event</li>
</ul>
</div>
<div id=\"content\">
<div id=\"map\">
<div id=\"title\">Show Position In Map</div>
<div id=\"current\">Initializing...</div>
<div id=\"options\">
<ul class=\"switches\">
<li class=\"active\" id=\"add\"><a href=\"#\">Post</a></li>
<li id=\"explore\"><a href=\"#\">Explore</a></li>
</ul>
</div>
<div class=\"slides\">
<div id=\"post\" class=\"active\">
<div id=\"input\">
<div id=\"tweet-bar\"><input type=\"text\" name=\"tweet\" placeholder=\"I'm curious about...\"></div>
<div id=\"controls\">
<div id=\"add-image\"></div>
<div id=\"tweet\"></div>
</div>
</div><!-- end input -->
<!--<div id=\"news\"></div>-->
</div><!-- end #post -->
<div>
<div id=\"output\">
<iframe src=\"http://finden.colegillespie.com\" width=\"800\" height=\"350\"></iframe>
</div>
</div>
</div>
</div>
</div><!-- end content -->
</body>
</html>";
}
elseif(isset($_GET['denied']))
{
// user denied access
echo 'You must sign in through twitter first';
}
else
{
// user not logged in
echo 'You are not logged in';
$url = $twitterObj->getAuthorizationUrl();
echo "<div style='width:200px;margin-top:200px;margin-left:auto;margin-right:auto'>";
echo "<a href='$url'>Sign In with Twitter</a>";
echo "</div>";
}
if(isset($_POST['submit']))
{
$msg = $_REQUEST['tweet'];
$twitterObj->setToken($_SESSION['ot'], $_SESSION['ots']);
$update_status = $twitterObj->post_statusesUpdate(array('status' => $msg));
$temp = $update_status->response;
echo "<b>Update status:".$temp."</b>";
#echo "<div align='center'>Updated your Timeline Successfully .</div>";
}
echo "<div style='margin-top:100px;'>";
echo "<p>";
echo "<center>";
echo "</center>";
echo "</p>";
echo "</div>";
?>