-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.php
83 lines (74 loc) · 2.34 KB
/
controller.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
<?php
session_start();
require './model.php';
$model = new Model();
// Login With Twitter
if( isset($_POST['login']) ) {
$model->twitter_connect();
}
// CallBack
if ( isset($_REQUEST['oauth_verifier'], $_REQUEST['oauth_token']) ) {
$model->callback();
}
//GetSelected User Profile
if(isset($_GET['followers']) ) {
$id = $_GET['usr_id'];
$model->getFollowerInfo($id);
}
// Download Public User Tweets
if( isset($_POST['search_public_user']) ) {
$key = $_POST['key'];
$model->downloadPublicUserTweets($key);
header('location: ./home.php');
}
if( isset($_POST['search_public_user_csv']) ) {
$key = $_POST['key'];
$model->downloadCSV($key);
header('location: ./home.php');
}
if( isset($_POST['search_public_user_xls']) ) {
$key = $_POST['key'];
$model->downloadXLS($key);
header('location: ./home.php');
}
if( isset($_POST['search_public_user_json']) ) {
$key = $_POST['key'];
$model->downloadJSON($key);
header('location: ./home.php');
}
if( isset($_POST['search_public_user_gd']) ) {
$key = $_POST['key'];
$_SESSION['user-tweets'] = $model->uploadGoogleDrive($key);
header('location:lib\google-drive-api/index.php');
}
if( isset($_GET['fetchFollowers']) ) {
$screen_name = $_GET['fetchFollowers'];
$model->getFollowers($screen_name);
}
if( isset($_GET['userdata']) && $_GET['userdata']==true ) {
$model->getUserData();
}
// // Download
// if( isset($_GET['download']) && $_GET['download']==true ) {
// $type=$_GET['type'];
// switch ($type) {
// case "csv":
// $model->downloadCSV();
// break;
// case "xls":
// $model->downloadXLS();
// break;
// case "json":
// $model->downloadJSON();
// break;
// case "google-spread-sheet":
// $_SESSION['user-tweets'] = $model->uploadGoogleDrive();
// header('location:lib\google-drive-api/index.php');
// break;
// }
// }
// Logout
if( isset($_GET['logout']) && $_GET['logout']==true ) {
$model->logout();
}
?>