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
// ---------------------------------------- | |
// IMPORTANT!!! | |
// ---------------------------------------- | |
// FIRST OF ALL, REMEMBER TO TURN ON PUBLIC READ PERMISSION IN YOUR SPREADSHEET IN GOOGLE. | |
// ---------------------------------------- | |
// BASE URL TO GET SHEET DATA | |
sheetsBaseURL = "https://docs.google.com/spreadsheets/d" |
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 | |
// Add this code in your 'theme folder' > functions.php | |
function my_customize_rest_cors() { | |
remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' ); | |
add_filter( 'rest_pre_serve_request', function( $value ) { | |
header( 'Access-Control-Allow-Origin: *' ); | |
header( 'Access-Control-Allow-Methods: GET' ); | |
header( 'Access-Control-Allow-Credentials: 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 | |
// https://pubsubhubbub.appspot.com/ | |
// https://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.4.html | |
// https://developers.google.com/youtube/v3/guides/push_notifications | |
// https://indieweb.org/How_to_publish_and_consume_WebSub#How_to_Subscribe | |
if(isset($_GET['hub_challenge'])){ | |
// Resposta para verificação do webhook | |
echo $_GET['hub_challenge']; |
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
let patternUrl = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/ | |
// source: https://www.regextester.com/94502 | |
// =============================== | |
// Test strings: | |
// =============================== | |
// https://www.example.com | |
// http://www.example.com | |
// www.example.com |