Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Display Twitter Follower Using PHP
$twitter_id = "tut_web";
$url = "$twitter_id";
$response = file_get_contents ( $url );
$count = 0;
$t_profile = new SimpleXMLElement ( $response );
$count = $t_profile->followers_count;
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
<title>Menampilkan Jumlah Follower Twitter Dengan PHP</title>
*{padding: 0;margin: 0;}
background: -webkit-radial-gradient(circle, #FFFFFF, #00ACED);
background: -moz-radial-gradient(circle, #FFFFFF, #00ACED);
background: -o-radial-gradient(circle, #FFFFFF, #00ACED);
background: -ms-radial-gradient(circle, #FFFFFF, #00ACED);
background: radial-gradient(circle, #FFFFFF, #00ACED);
a{text-decoration: none; color: #0B486B;}
div{text-align: center}
div h1{
display: block;
font-size: 30px;
div h2{padding: 20px;font-size: 40px}
div img{width: 100px;height: 100px;}
div h3{
margin: 0 auto;
background: rgba(0, 172, 237, .2);
border-radius: 50%;
padding: 100px;
font-size: 50px;
display: table;
div h3:hover{background:#0B486B;}
div h3:hover a{color:#fff;}
div h3 span{
display: block;
font-size: 20px;
<h1><a href=""></a></h1>
<img src="" alt="">
<h2><a href="<?=$twitter_id;?>">@<?=$twitter_id;?></a></h2>
<a href="<?=$twitter_id;?>">
<?php echo $count;?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.