<?php | |
$input = json_decode(file_get_contents('php://input')); | |
if($input && property_exists($input, 'items') && count($input->items)) { | |
$item = $input->items[0]; | |
$url = $item->permalinkUrl; | |
$ch = curl_init('https://telegraph.p3k.io/webmention'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_POST, true); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ | |
'token' => 'xxxx.YOUR.TOKEN.HERE.xxxx', | |
'source' => $url, | |
'target_domain' => 'example.com' | |
])); | |
curl_exec($ch); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment