Skip to content
Extraits de code Groupes Projets
Valider 203c2117 rédigé par Kevin XU's avatar Kevin XU
Parcourir les fichiers

Intégration graphes pour Youtube

parent 5bba20da
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -130,6 +130,8 @@ $youtube_fav = $_SESSION['youtube']; ...@@ -130,6 +130,8 @@ $youtube_fav = $_SESSION['youtube'];
} }
?> ?>
<br/> <h5></h5> </div> <br/> <h5></h5> </div>
</br><br/>
</div>
</div> </div>
</div> </div>
...@@ -143,8 +145,13 @@ $youtube_fav = $_SESSION['youtube']; ...@@ -143,8 +145,13 @@ $youtube_fav = $_SESSION['youtube'];
echo "<a href='#b'> Evolution of Tweets Retweets</a>"; echo "<a href='#b'> Evolution of Tweets Retweets</a>";
} }
elseif ($socialNetwork === "Youtube") { elseif ($socialNetwork === "Youtube") {
echo "<a href='#a'> Evolution of Views</a>"; echo "<a href='#a'> Evolution of Views of recent videos</a>";
echo "</div>";
echo "<div>";
echo "<a href='#b'> Evolution of Likes of recent videos</a>";
echo "</div>"; echo "</div>";
echo "<div>";
echo "<a href='#c'> Evolution of Dislikes of recent videos</a>";
} }
?> ?>
</div> </div>
...@@ -157,7 +164,7 @@ $youtube_fav = $_SESSION['youtube']; ...@@ -157,7 +164,7 @@ $youtube_fav = $_SESSION['youtube'];
echo "Evolution of Tweets Likes"; echo "Evolution of Tweets Likes";
} }
elseif ($socialNetwork === "Youtube") { elseif ($socialNetwork === "Youtube") {
echo "Evolution of Views"; echo "Evolution of Views of recent videos";
} }
?> ?>
</span><br/><br/> </span><br/><br/>
...@@ -176,7 +183,16 @@ $youtube_fav = $_SESSION['youtube']; ...@@ -176,7 +183,16 @@ $youtube_fav = $_SESSION['youtube'];
lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $likes, 700, 400); lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $likes, 700, 400);
} }
elseif ($socialNetwork === "Youtube") { elseif ($socialNetwork === "Youtube") {
echo ""; $count = 10;
$chartName = "chart3";
$caption = "Evolution of views : Last ".$count." videos";
$xAxisName = "Video (from most recent to oldest)";
$yAxisName = "Number of Views";
$views = getviewCountOfRecentVideo($id, $count);
lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $views, 700, 400);
} }
?> ?>
</br><br/> </br><br/>
...@@ -187,7 +203,7 @@ $youtube_fav = $_SESSION['youtube']; ...@@ -187,7 +203,7 @@ $youtube_fav = $_SESSION['youtube'];
echo "Evolution of Tweets Retweets"; echo "Evolution of Tweets Retweets";
} }
elseif ($socialNetwork === "Youtube") { elseif ($socialNetwork === "Youtube") {
echo ""; echo "Evolution of Likes of recent videos";
} }
?> ?>
</span><br/><br/> </span><br/><br/>
...@@ -206,11 +222,83 @@ $youtube_fav = $_SESSION['youtube']; ...@@ -206,11 +222,83 @@ $youtube_fav = $_SESSION['youtube'];
lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $retweets, 700, 400); lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $retweets, 700, 400);
} }
elseif ($socialNetwork === "Youtube") { elseif ($socialNetwork === "Youtube") {
$count = 10;
$chartName = "chart4";
$caption = "Evolution of likes : Last ".$count." videos";
$xAxisName = "Video (from most recent to oldest)";
$yAxisName = "Number of Likes";
$likes = getLikeCountOfRecentVideo($id, $count);
lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $likes, 700, 400);
}
?>
</br><br/>
</div>
<div id='c'><br/><br/><span class="title_graphs">
<?php
if ($socialNetwork === "Twitter") {
echo "";
}
elseif ($socialNetwork === "Youtube") {
echo "Evolution of Dislikes of recent videos";
}
?>
</span><br/><br/>
<?php
if ($socialNetwork === "Twitter") {
echo ""; echo "";
} }
elseif ($socialNetwork === "Youtube") {
$count = 10;
$chartName = "chart5";
$caption = "Evolution of dislikes : Last ".$count." videos";
$xAxisName = "Video (from most recent to oldest)";
$yAxisName = "Number of Dislikes";
$dislikes = getDislikeCountOfRecentVideo($id, $count);
lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $dislikes, 700, 400);
}
?> ?>
</br><br/> </br><br/>
</div> </div>
<!-- <div id='d'><br/><br/><span class="title_graphs">
<?php
// if ($socialNetwork === "Twitter") {
// echo "";
// }
// elseif ($socialNetwork === "Youtube") {
// echo "Evolution of views of most popular videos";
// }
?>
</span><br/><br/>
<?php
// if ($socialNetwork === "Twitter") {
// echo "";
// }
// elseif ($socialNetwork === "Youtube") {
// $count = 10;
// $chartName = "chart6";
// $caption = "Evolution of views : ".$count." most popular videos";
// $xAxisName = "Video (from most recent to oldest)";
// $yAxisName = "Number of Views";
// $videosID = getCountTopVideos($id, $count);
// $views = [];
// for ($i = 0; $i < $count; $i++) {
// $views[] = getVideoViewCountById($videosID[$i]);
// }
// lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $views, 700, 400);
// }
?>
</br><br/>
</div> -->
</div> </div>
</div> </div>
......
...@@ -47,6 +47,7 @@ if (isset($_POST['register'])) { ...@@ -47,6 +47,7 @@ if (isset($_POST['register'])) {
} }
$empty_array = array(); $empty_array = array();
// Finally, register user if there are no errors in the form // Finally, register user if there are no errors in the form
echo $errors[0];
if (count($errors) == 0) { if (count($errors) == 0) {
$password = md5($password_1);//encrypt the password before saving in the database $password = md5($password_1);//encrypt the password before saving in the database
......
...@@ -109,7 +109,7 @@ function getVideoViewCountById($id){ ...@@ -109,7 +109,7 @@ function getVideoViewCountById($id){
/** /**
* Search Get the most populare count videos's id in a channel by channelID * Search Get the most popular count videos's id in a channel by channelID
* @param $channelId * @param $channelId
* @param $count * @param $count
* @return an array including the id of the most populare count videos * @return an array including the id of the most populare count videos
...@@ -189,5 +189,7 @@ function getLikeCountOfRecentVideo($channelId,$count) ...@@ -189,5 +189,7 @@ function getLikeCountOfRecentVideo($channelId,$count)
} }
//print_r(getCountTopVideos("UCWeg2Pkate69NFdBeuRFTAw", 10));
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter