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 | |
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication | |
# http://creativecommons.org/publicdomain/zero/1.0/ | |
function postToMedium($data=array()) { | |
$user_id = "XXXX"; | |
$accessToken = "XXXX"; | |
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
{% set no_protocol = url|split('//')[1] ?: url %} | |
{% set only_domains = no_protocol|split('/')[0] ?: no_protocol %} | |
{% set url_domain = '' %} | |
{% if only_domains|split('.')[2] %} | |
{% set url_domain = only_domains|split('.')[1] %} | |
{% else %} | |
{% set url_domain = only_domains|split('.')[0] %} | |
{% endif %} |