public function revoke(Request $request) { $curl = new \Curl\Curl(); $params = ['client_secret' => env('UBER_CLIENT_SECRET'), 'client_id' => env('UBER_CLIENT_ID'), 'token' => $request->session()->get('uber.token')]; $curl->post('https://login.uber.com/oauth/revoke', $params); /* $data = $curl->response; dd($data); */ }
require_once APP_ROOT . '/lib/SteamID/SteamID.php'; use Curl\Curl; $app->get('/tasks/link_steam_profiles', function () use($app) { $sleep_time = 100; $steam_api_key = $app['bm.config']['steam_api_key']; $unlinked_player_profiles = $app['mongo.db']->selectCollection('player_profiles')->find(['steamdata' => ['$type' => 10]])->sort(['points' => -1])->limit(50); $unlinked_player_profiles = array_map(function ($player_profile_doc) use($steam_api_key) { $steamid3_value = $player_profile_doc['payload_steamid']; $steam_api_url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?"; $steam_api_url .= "key={$steam_api_key}"; $steam_api_url .= "&steamids="; $steam_id = SteamID::Parse("[U:1:{$steamid3_value}]"); $steamid64 = $steam_id->Format(SteamID::FORMAT_STEAMID64); if ($steamid64) { $steam_api_url .= $steamid64; $curl = new \Curl\Curl(); $curl->get($steam_api_url); $steamdata = json_decode(json_encode($curl->response), 1); $player_profile_doc['steamdata'] = @$steamdata['response']['players'][0] ?: null; @($player_profile_doc['steamdata']['personaname'] = strip_tags($player_profile_doc['steamdata']['personaname'])); // remove all unicode and html from usernames, move this to functions.php file $player_profile_doc['steamid64'] = $steamid64; } return $player_profile_doc; }, iterator_to_array($unlinked_player_profiles, 0)); array_walk($unlinked_player_profiles, function ($player_profile_doc) use($app, $sleep_time) { if (empty($player_profile_doc['steamdata'])) { echo "no steamdata received for {$player_profile_doc['payload_steamid']}\n"; return; } print_r($player_profile_doc);