if (isset($_GET['action'])) { $action = $_GET['action']; if (isset($_POST['username']) && isset($_POST['auth_token']) || isset($_GET['username']) && isset($_GET['auth_token'])) { if (isset($_POST['username']) && isset($_POST['auth_token'])) { $username = $_POST['username']; $auth_token = $_POST['auth_token']; } if (isset($_GET['username']) && isset($_GET['auth_token'])) { $username = $_GET['username']; $auth_token = $_GET['auth_token']; } $snapchat = new Snapchat(); $snapchat->username = $username; $snapchat->auth_token = $auth_token; if (ExtendedProfile::get_by_username($snapchat->username) == false) { $object = new ExtendedProfile(); $object->username = $snapchat->username; $object->create(); } if ($action == "getupdates") { $result = $snapchat->getUpdates2(); formatSnaps($result, $snapchat); $response->status = OKAY; $response->message = $result; } if ($action == "getcaptcha") { $result = $snapchat->getCaptcha(); $response->status = OKAY; $response->message = $result; } if ($action == "deletestory") {
file_put_contents($theFile, base64_decode($fromextendedprofile->picture)); } } $object->fromprofilepicture = HOST . "includes/webservices/images/extendedprofiles/" . $fromextendedprofile->id . ".jpg"; } } } $response = $objects; } else { if ($_GET['object'] == "likedboxsnap") { $sql = "SELECT * FROM " . T_LIKEDBOXSNAPS; $objects = likedBoxSnap::get_by_sql($sql); $response = $objects; } else { if ($_GET['object'] == "theprofiles") { $objects = ExtendedProfile::get_all(); $response = "TOTAL: " . count($objects) . "<br/><br/>"; $profiles = ""; foreach ($objects as $object) { $profiles .= $object->username . "<br/>"; } $response .= $profiles; } else { $response = "Object Specified Does Not Exists"; } } } } } } }