Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php class FacebookFunc { private $accessToken; public function __construct($accessT..
Decoded Output download
<?php
class FacebookFunc {
private $accessToken;
public function __construct($accessToken) {
$this->accessToken = $accessToken;
}
private function curl_get_file_contents($URL) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$contents = curl_exec($ch);
curl_close($ch);
if ($contents) {
return $contents;
} else {
return false;
}
}
private function getAccessToken() {
//get facebook app token
return $this->accessToken;
}
public function postMessage($message__) {
//action post message to timeline
$url = "https://graph.facebook.com/me/feed?method=POST&message=";
$url .= $message__;
$url .= "&access_token=";
$url .= $this->accessToken;
$response = $this->curl_get_file_contents($url);
$result = json_decode($response, true);
return $result;
}
public function getFeed($feedID) {
$url = "https://graph.facebook.com/";
$url .= $feedID;
$url .= "/feed/?access_token=";
$url .= $this->accessToken;
$response = $this->curl_get_file_contents($url);
$result = json_decode($response, true);
return $result;
}
public function commentAt($postID, $message) {
$url = "https://graph.facebook.com/";
$url .= $postID;
$url .= "/comments";
$url .= "/?message=";
$url .= $message;
$url .= "&access_token=";
$url .= $this->accessToken;
$url .= "&method=post";
$response = $this->curl_get_file_contents($url);
$result = json_decode($response, true);
return $result;
}
}
?>
Did this file decode correctly?
Original Code
<?php
class FacebookFunc {
private $accessToken;
public function __construct($accessToken) {
$this->accessToken = $accessToken;
}
private function curl_get_file_contents($URL) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$contents = curl_exec($ch);
curl_close($ch);
if ($contents) {
return $contents;
} else {
return false;
}
}
private function getAccessToken() {
//get facebook app token
return $this->accessToken;
}
public function postMessage($message__) {
//action post message to timeline
$url = "https://graph.facebook.com/me/feed?method=POST&message=";
$url .= $message__;
$url .= "&access_token=";
$url .= $this->accessToken;
$response = $this->curl_get_file_contents($url);
$result = json_decode($response, true);
return $result;
}
public function getFeed($feedID) {
$url = "https://graph.facebook.com/";
$url .= $feedID;
$url .= "/feed/?access_token=";
$url .= $this->accessToken;
$response = $this->curl_get_file_contents($url);
$result = json_decode($response, true);
return $result;
}
public function commentAt($postID, $message) {
$url = "https://graph.facebook.com/";
$url .= $postID;
$url .= "/comments";
$url .= "/?message=";
$url .= $message;
$url .= "&access_token=";
$url .= $this->accessToken;
$url .= "&method=post";
$response = $this->curl_get_file_contents($url);
$result = json_decode($response, true);
return $result;
}
}
?>
Function Calls
None |
Stats
MD5 | 583d56c3e3bcb47855590ffbb2fb29e7 |
Eval Count | 0 |
Decode Time | 167 ms |