Skip to content

Instantly share code, notes, and snippets.

View SecureCloud-biz's full-sized avatar

Terry DeSimone SecureCloud-biz

View GitHub Profile
<?php
$sr = $facebook->getSignedRequest();
// check if the page has been liked
if ( !isset( $sr ) || !isset( $sr['page']['liked'] ) || $sr['page']['liked'] != true ) {
// likegate
header( 'Location: likegate.php' );
} else {
// regular content
Array
(
[algorithm] => HMAC-SHA256
[issued_at] => 1378146888
[page] => Array
(
[id] => 1234567890
[liked] => 1
[admin] => 1
)
<?php
// change these to match your app
$app_id = '1234567890';
$app_secret = 'abcdefghijklmnopqrstuvwxyz';
// init facebook class
$facebook = new Facebook( array( 'appId' => $app_id, 'secret' => $app_secret ) );
/* Ban Users */
<?php
// change these to match your app
$app_id = '1234567890';
$app_secret = 'abcdefghijklmnopqrstuvwxyz';
// init facebook class
$facebook = new Facebook( array( 'appId' => $app_id, 'secret' => $app_secret ) );
// call {app_id}/banned/ using app access_token
<?php
require_once( 'parse/parse.php' );
$parseQuery = new parseQuery('_User');
$result = $parseQuery->find();
foreach ( $result->results as $user ) {
unset( $user->email );
if ( isset( $user->authData->facebook ) ) {
unset( $user->authData->facebook->access_token );
{
"error": {
"message": "(#200) The user hasn't authorized the application to perform this action",
"type": "OAuthException",
"code": 200
}
}
{
"id": "01234567890_001122334455667788"
}
POST https://graph.facebook.com/[page_id]/feed?access_token=[page_access_token]
&name=Facebook API: Posting As A Page
&link=https://www.webniraj.com/2012/08/09/facebook-api-posting-as-a-page/
&caption=The Facebook API lets you post to Pages you own automatically - either as real-time updates or in the case that you want to schedule posts.
&message=Check out my new blog post!
{
"data": [
{
"name": "Your Page",
"access_token": "AAAAABBBBBBBBBBCCCCCCCCCCCDDDDDDDDDEEEEEEEEEFFFFFFGGGGGGHHHHHHIIIIIIJJJJJJJJKKKKKKKKLLLLLLLLL",
"category": "Website",
"id": "01234567890",
"perms": [
"ADMINISTER",
"EDIT_PROFILE",
if (typeof console == "object") {
if ( navigator.userAgent.indexOf('Chrome') != -1 ) {
console.log("%cHey! What are you looking under here for? https://www.webniraj.com/", "color: #0677c8; font-size: 18px; font-family: 'Helvetica-Neue', Helvetica, Arial, sans-serif;");
} else {
console.log("Hey! What are you looking under here for? https://www.webniraj.com/");
}
}