Skip to content
Extraits de code Groupes Projets
Valider 0daf17aa rédigé par Florence's avatar Florence
Parcourir les fichiers

Instagram, Facebook profil

parent 089c711a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
<!DOCTYPE html>
<div id="fb-root"></div>
<script async defer crossorigin="anonymous"
src="https://connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v4.0&appId=534943017281203&autoLogAppEvents=1">
</script>
<?php
//$influenceur = "EnjoyPhoenixChannel";
$influenceur= $_POST['devis'];
?>
<div class="fb-page"
data-href="https://www.facebook.com/<?= $influenceur?>/"
data-tabs="timeline"
data-width=""
data-height=""
data-small-header="false"
data-adapt-container-width="true"
data-hide-cover="false"
data-show-facepile="true">;
<blockquote cite="https://www.facebook.com/<?= $influenceur?>/" class="fb-xfbml-parse-ignore">;
<a href="https://www.facebook.com/<?= $influenceur?>/">Facebook</a></blockquote></div>;
</html>
\ No newline at end of file
Ce diff est replié.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="ressources/css/instagram.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<style>
.posts{
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
}
.like-comment{
font-size: 10px;
color:#333;
padding-bottom: 40px;
font-weight: bold;
}
</style>
<div id="fond" style="background: #DEB887">
<div class="row">
<div class="col-md-3">
<img src="" class="profile-pic" style="border-radius:50%;opacity: 0.8;filter: alpha(opacity=80);position: relative;top:20px; left:25px; ">
</div>
<div class="col-md-9">
<h2 class="username" style="font-size: 30px;position: relative;top:15px; left:-10px;"></h2>
<br/>
<div class="row"style="margin-top:-10px; position: relative;top:15px; left:-10px;">
<div class="col-md-4" >
<span class="number-of-posts"></span> posts
</div>
<div class="col-md-4">
<span class="followers"></span> followers
</div>
<div class="col-md-4">
<span class="following"></span> following
</div>
</div>
<div class="row" style="margin-top:10px;">
<h4 class="name" style="margin-top:10px;position: relative;top:15px; left:5px;"></h4>
</div>
<div class="row">
<h4 class="biography"style="font-size:11px;position: relative;top:15px; left:8px;margin-top:10px;"></h4>
</div>
<hr color="black" >
<div class="row" >
<p style="position: relative;left:-80px;">POSTS</p>
</div>
<div class="row posts" style="position: relative;left:-90px;"></div>
</div>
</div>
</div>
<script>
function nFormatter(num){
if(num >= 1000000){
return (num/1000000).toFixed(1).replace(/\.0$/,'') + 'M';
}
if(num >= 1000){
return (num/1000).toFixed(1).replace(/\.0$/,'') + 'K';
}
return num;
}
$.ajax({
url:"https://www.instagram.com/<?php echo $_GET['user'];?>?__a=1",
type:'get',
success:function(response){
$(".profile-pic").attr('src',response.graphql.user.profile_pic_url);
$(".name").html(response.graphql.user.full_name);
$(".biography").html(response.graphql.user.biography);
$(".username").html(response.graphql.user.username);
$(".number-of-posts").html(response.graphql.user.edge_owner_to_timeline_media.count);
$(".followers").html(nFormatter(response.graphql.user.edge_followed_by.count));
$(".following").html(nFormatter(response.graphql.user.edge_follow.count));
posts = response.graphql.user.edge_owner_to_timeline_media.edges;
posts_html = '';
for(var i=0;i<posts.length;i++){
url = posts[i].node.display_url;
likes = posts[i].node.edge_liked_by.count;
comments = posts[i].node.edge_media_to_comment.count;
posts_html += '<div class="col-md-4 equal-height"><img style="min-height:50px;background-color:#fff;width:100%" src="'+url+'"><div class="row like-comment"><div class="col-md-6">'+nFormatter(likes)+' LIKES</div><div class="col-md-6">'+nFormatter(comments)+' COMMENTS</div></div></div>';
}
$(".posts").html(posts_html);
}
});
</script>
</body>
</html>
<!DOCTYPE html>
<?php
require_once '../../apps/vendor/autoload.php';
$fb = new Facebook\Facebook([
'app_id' => '534943017281203',
'app_secret' => '6c0574bd9f5146a0930c54d74880971b',
'default_graph_version' => 'v4.0',
]);
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get('/EnjoyPhoenixChannel?fields=count', '534943017281203|ZRI1S20YH6YtHZ8qJCAZX4781OI');
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
echo 'Name: ' . $graphNode;
?>
</html>
\ No newline at end of file
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