This repository has been archived by the owner on Mar 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
proxyWebService.php
executable file
·64 lines (54 loc) · 2.13 KB
/
proxyWebService.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
<?php
//curl_setopt($ch, CURLOPT_URL, "localhost:8080/evoTweet?path=".urlencode($_GET['path'])."&seg=".urlencode($_GET['seg']));
if(isset($_GET['action'])){
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
switch($_GET['action']){
case "evoTweet" :
$url ="localhost:8080/evoTweet?path=".urlencode($_GET['path'])."&seg=".urlencode($_GET['seg']);
break;
case "associatedHashtags":
$url = "localhost:8080/associatedHashtags?path=".urlencode($_GET['path']);
break;
case "stream" :
$url = "localhost:8080/stream?hashgtags=".urlencode($_GET['hashtags']);
break;
case "attributs" :
$url = "localhost:8080/attributs?nomFichier=".urlencode($_GET['nomFichier']);
break;
case "stats" :
$file = "nomFichier=".urlencode($_GET["nomFichier"]);
$attr = "attribut=".urlencode($_GET["attribut"]);
$seg = "segment=".urlencode($_GET["segment"]);
$filtre = "filtre=".urlencode($_GET["filtre"]);
$url = "localhost:8080/stats?$file&$attr&$seg&$filtre";
break;
case "courbe" :
$file = "nomFichier=".urlencode($_GET["nomFichier"]);
$attr1 = "attribut1=".urlencode($_GET["attribut1"]);
$attr2 = "attribut2=".urlencode($_GET["attribut2"]);
$filtre = "filtre=".urlencode($_GET["filtre"]);
$url = "localhost:8080/courbe?$file&$attr1&$attr2&$filtre";
break;
case "kmeans" :
$file = "nomFichier=".urlencode($_GET["nomFichier"]);
$clust = "nbClusters=".urlencode($_GET["nbClusters"]);
$filtre = "filtre=".urlencode($_GET["filtre"]);
$url = "localhost:8080/kmeans?$file&$clust&$filtre";
break;
case "kmeans_Stats" :
$file = "nomFichier=".urlencode($_GET["nomFichier"]);
$attr = "attribut=".urlencode($_GET["attribut"]);
$seg = "segment=".urlencode($_GET["segment"]);
$clust = "nbClusters=".urlencode($_GET["nbClusters"]);
$filtre = "filtre=".urlencode($_GET["filtre"]);
$url = "localhost:8080/kmeans_Stats?$file&$attr&$seg&$clust&$filtre";
break;
}
curl_setopt($ch, CURLOPT_URL, $url);
header('Content-Type: application/json');
echo curl_exec($ch);
curl_close($ch);
}
?>