Skip to content

Instantly share code, notes, and snippets.

@colmdoyle
Created June 1, 2011 16:39
Show Gist options
  • Save colmdoyle/1002713 to your computer and use it in GitHub Desktop.
Save colmdoyle/1002713 to your computer and use it in GitHub Desktop.
A script to remove all test users associated with your Facebook Platform Application
<?php
// jSON URL which should be requested
$json_url = 'https://graph.facebook.com/YOUR_APP_ID/accounts/test-users?access_token=YOUR_APP_ID|YOUR_APP_SECRET';
// Initializing curl
$ch = curl_init( $json_url );
// Configuring curl options
$options = array(
CURLOPT_RETURNTRANSFER => true,
);
// Setting curl options
curl_setopt_array( $ch, $options );
// Getting results
$result = curl_exec($ch); // Getting jSON result string
$resultArray = json_decode($result, true);
foreach($resultArray as $nestedArray)
{
foreach($nestedArray as $superNested)
{
$testUID = $superNested["id"];
$access_token = $superNested["access_token"];
$string = "https://graph.facebook.com/$testUID?method=delete&access_token=$access_token";
$nukeCh = curl_init($string);
echo($string.'<br/>');
curl_exec($nukeCh);
echo('<br/>');
}
}
?>
@maroshii
Copy link

maroshii commented Sep 6, 2013

THIS

@sickelap
Copy link

sickelap commented Apr 2, 2014

(y)

@mishrav
Copy link

mishrav commented Aug 2, 2017

👍

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