This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$content = 'Message to send'; | |
$username = 'Discord Bot'; | |
// set your own Discord webhook URL | |
$url = "https://discord.com/api/webhooks/00000000000000000000/000000000000000000000000000000000000000000000000000000000000"; | |
//send message | |
$headers = [ 'Content-Type: application/json; charset=utf-8' ]; | |
$POST = [ 'username' => $username, 'content' => $content ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$TWITCH_API_KEY = ''; // your Client ID | |
$TWITCHUSERID = ''; // Twitch User ID number | |
$url = 'https://api.twitch.tv/helix/streams?user_id='.$TWITCHUSERID; | |
$ch = curl_init(); | |
$headers=['Client-ID: '.$TWITCH_API_KEY]; | |
curl_setopt($ch, CURLOPT_URL,$url); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$TWITCH_API_KEY = ''; // your Client ID | |
$TWITCHUSER = ''; // Twitch Username | |
$url = 'https://api.twitch.tv/helix/users?login='.$TWITCHUSER; | |
$ch = curl_init(); | |
$headers=['Client-ID: '.$TWITCH_API_KEY]; | |
curl_setopt($ch, CURLOPT_URL,$url); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/** | |
* Script used to update DNS records in Cloud Flare when server IP address changes. | |
* My use case is to run this script on startup, when I spin up a new Digital Ocean VPS but | |
* this could easily be used to update for dynamic DNS with a cronjob. | |
* | |
* Digital Ocean referral code: https://www.digitalocean.com/?refcode=3655e259ce29 | |
* | |
* Requires PHP cURL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'https://api.sendgrid.com/'; | |
$user = 'sendgridapiusername'; | |
$pass = 'sendgridapipassword'; | |
$params = array( | |
'api_user' => $user, | |
'api_key' => $pass, | |
'to' => '[email protected]', |