Skip to content

Instantly share code, notes, and snippets.

@maagmirror
Last active January 21, 2016 00:57
Show Gist options
  • Save maagmirror/92ffeb7f46305ac3d3fa to your computer and use it in GitHub Desktop.
Save maagmirror/92ffeb7f46305ac3d3fa to your computer and use it in GitHub Desktop.
<html>
<title>bot</title>
<body background="/background.jpg">
<body>
<TABLE WIDTH="100%" HEIGHT="100%">
<TR>
<TD VALIGN="MIDDLE" ALIGN="CENTER">
<font size=10 color="white">
<?php
$url = 'http://www.taringa.net/ajax/mentions/user';
$fields = array(
'uid' => '25854531' //Id del usuario
);
$fields_string="";
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$data = json_decode($result,true);
$status = $data['data']['userStatus'];
if($status == 'offline') {
echo '<div style="color:red">offline<div>' ;
}
else {
echo '<div style="color:green">online<div>' ;
}
?>
</TD>
</TR>
</TABLE>
</BODY>
</font>
</html>
@santiq
Copy link

santiq commented Jan 21, 2016

$status = $data['data']['userStatus']; 

if($status == 'offline')
   echo '<div style="color:red">offline<div>' 
else 
  echo '<div style="color:green">online<div>' 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment