Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Set names to lowercase for URL injection.
- $ToLower = strtolower($_GET["To"]);
- // Inject lowercase names to get correct capitalization of usernames.
- $ch = curl_init("https://api.twitch.tv/kraken/channels/" . $ToLower);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $result = curl_exec($ch);
- curl_close($ch);
- // Decode the above JSON data.
- $ToCorrectName = json_decode($result, true);
- // No name was entered after the command.
- if (empty($_GET["To"]))
- {
- echo 'Hey ' . htmlspecialchars($_GET["From"]) . ' to need to specify a user to direct the !give command towards!';
- die();
- }
- // No such Twitch user exists, yet.
- if($ToCorrectName['display_name'] == null)
- {
- echo 'Sorry, ' . htmlspecialchars($_GET["From"]) . ', ' . htmlspecialchars($_GET["To"]) . ' isn\'t a Twitch streamer!';
- die();
- }
- // Array of places to lick.
- $Licks = array
- (
- "the tongue!",
- "their face!",
- "the eye!",
- "their hair!",
- "their cheek!",
- "their finger!",
- "their elbow!",
- "their nipple!",
- "their hairy chest!",
- "their groin! <3",
- "their knee!",
- "their booty hole! GROSS!",
- "their thigh!",
- "their foot!",
- "their toes!"
- );
- // Count the array size, and return a ranodm entry from the array.
- $Lick = $Licks[mt_rand(0, count($Licks) - 1)];
- // Print the output.
- echo htmlspecialchars($_GET["From"]) . ' licks ' . $ToCorrectName['display_name'] . ' on ' . $Lick . ', lick lick';
- ?>
- Example: Lick.php?From=Myself&To=TwitchUsername
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement