-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·223 lines (213 loc) · 9.43 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<?php
if(!isset($_SESSION)) session_start();
include_once("secret.php");
include_once("backend.php");
if(isset($_SESSION['ot']) && isset($_SESSION['ots']))
{
$oauth_access_token = $_SESSION['ot'];
$oauth_access_token_secret = $_SESSION['ots'];
}
else
{
header("Location:twit-login.php");
die();
}
/** Set access tokens here - see: https://dev.twitter.com/apps/ **/
$settings = array(
'oauth_access_token' => $oauth_access_token,
'oauth_access_token_secret' => $oauth_access_token_secret,
'consumer_key' => $consumer_key,
'consumer_secret' => $consumer_secret
);
$api_end_point = "https://api.twitter.com/1.1";
if(isset($_REQUEST['ajax_tweet_function'])) {
$param = array(
'settings' => $settings,
'api_end_point' => $api_end_point,
'params' => isset($_REQUEST['ajax_tweet_param']) ? $_REQUEST['ajax_tweet_param'] : ""
);
echo call_user_func($_REQUEST['ajax_tweet_function'], $param);
exit();
}
?>
<?php include_once("header.php") ?>
<div class="container">
<div id="userInfo" class="row">
</div>
<div class="row">
<div class="col-lg-12 menu">
<a href="#" data-type="followers" class="btn btn-primary filter">Followers</a>
<a href="#" data-type="friends" class="btn btn-primary filter">Friends</a>
<a href="#" data-type="not-followers" class="btn btn-primary filter">Not Following</a>
<a href="#" data-type="copy" class="btn btn-primary filter">Copy</a>
<input type="button" id="unFollowAll" value="Unfollow All" class="hidden btn btn-xs btn-danger" />
</div>
</div>
<div class="row hidden copyForm">
<form id="copyForm" role="form">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="screen_name" placeholder="@username" class="form-control" />
</div>
<div class="form-group">
<label for="request_type">Request type</label>
<select id="request_type" class="form-control">
<option value="followers">Followers</option>
<option value="friends">Friends</option>
</select>
</div>
<div class="form-group">
<label for="hide">Hide previously followed user:</label>
<input type="checkbox" id="previous_followed" class="form-control" />
<label for="app">(Through this app)</label>
</div>
<div class="form-group">
<label for="continuously">Copy continuously </label>
<input type="checkbox" id="copy_continuously" class="form-control" />
<label for="app">(Follow people from next pages also)</label>
</div>
<button type="submit" value="Go" name="copy" class="btn btn-default">Submit</button>
</form>
<button type="button" name="copyAll" id="copyAll" class="btn btn-xs btn-success hidden pull-right">Copy All</button>
</div>
<div class="row hidden message">
<label for="message">Send Direct Message</label>
<textarea rows="3" id="message" class="form-control"></textarea>
<button type="button" value="Go" id="send_message" class="btn btn-default">Send Message</button>
Word count (Should be less than or equal 140):<label for="message length" id="message_length">0</label>
</div>
<div class="row card hidden">
<h5><strong>Filter</strong></h5>
<ul>
<li>
<p>Exclude people you have followed in the past
<select id="filterDay">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="7">7</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="60">60</option>
</select> days
<input type="button" id="filterNotFollowing" value="Filter" />
<input type="button" id="unFollowAll" value="Unfollow All" class="hidden btn btn-xs btn-danger" />
</p>
</li>
</ul>
</div>
<div class="row donateButton">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Undosto twitter -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8883766202094793"
data-ad-slot="4741842253"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<div id="listContainer">
</div>
<p class="pull-right">
<button data-nextcursor="" id="nextCursor" class="hidden nextButton">Next</button>
</p>
</div>
<!-- template part start -->
<script id="template-userInfo" type="text/x-handlebars-template">
<div class="col-lg-12">
<div class="media">
<a class="thumbnail pull-left" href="https://twitter.com/{{user.screen_name}}">
<img class="media-object" src="{{user.profile_image_url}}">
</a>
<div class="media-body">
<h4 class="media-heading">{{user.name}}</h4>
<p>
<span class="btn btn-xs btn-info">@{{user.screen_name}}</span>
<span class="btn btn-xs btn-info">{{user.followers_count}} followers</span>
<span class="btn btn-xs btn-warning">{{user.friends_count}} friends</span>
<a href="/logout.php" class="btn btn-xs btn-default"><span class="glyphicon glyphicon-log-out"></span> Signout</a>
</p>
</div>
</div>
</div>
</script>
<script id="template-listContainer" type="text/x-handlebars-template">
<div class="row rowBorder" data-screen-name="{{user.screen_name}}" data-id="{{user.id_str}}">
<div class="col-lg-12 col-md-12 col-sm-12">
<a class="thumbnail pull-left" href="https://twitter.com/{{user.screen_name}}">
<img class="media-object" src="{{user.profile_image_url}}">
</a>
<div class="media-body">
<h4 class="media-heading">{{user.name}}
{{#if user.follower}}
<button class="follower btn btn-xs btn-success" title="follows me"><i class="glyphicon glyphicon-ok"></i> Follows me</button>
{{/if}}
</h4>
<p>
<a class="btn btn-xs btn-info" href="https://twitter.com/{{user.screen_name}}" target="_blank">@{{user.screen_name}}</a>
<button class="btn btn-success btn-xs hidden message-status">Message Sent</button>
{{#if user.following}}
<button class="unfollow btn btn-xs btn-danger pull-right" title="I follow" data-id="{{user.id_str}}"><i class="glyphicon glyphicon-remove"></i> Unfollow</button>
{{else}}
<button class="follow btn btn-xs btn-success pull-right" title="I dont follow" data-id="{{user.id_str}}"><i class="glyphicon glyphicon-plus"></i> Follow</button>
{{/if}}
</p>
</div>
</div>
</div>
</script>
<script id="template-errorModal" type="text/x-handlebars-template">
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Error</h4>
</div>
<div class="modal-body">
<p>{{{errors.message}}}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</script>
<script id="template-adModal" type="text/x-handlebars-template">
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><a href="/advertise.php">Advertise with us</a></h4>
</div>
<div class="modal-body">
<p>{{{advertise.content}}}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</script>
<!-- template part end -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/handlebars.js"></script>
<script src="js/index.js"></script>
<script src="js/twitter.js"></script>
</body>
</html>