<?php
$curl = curl_init();
// Get the current post ID.
$post_id = get_the_ID();
// Get the 'video_refresh_url' ACF field value for the current post.
$video_refresh_url = get_field("chau_video_refresh_url", $post_id);
// Use the variable $video_refresh_url for the cURL request.
curl_setopt_array($curl, [
CURLOPT_URL => $video_refresh_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer E9YdEy6ZAjvigAwY8jCxCJdE2zTp0AO8lv5Jk8sP",
"User-Agent: insomnia/8.4.5"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
//process response to shorten url
$responseData = json_decode($response, true);
// Extract the long URL
$longUrl = $responseData['value'][0]['file'];
echo $longUrl;
$yourls_api_url = 'https://links.omnichannelplus.com/yourls-api.php';
$token = '63a72d7acd';
// Prepare data for API request
$data = array(
'signature' => $token,
'action' => 'shorturl',
'url' => $longUrl,
'format' => 'json'
);
// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $yourls_api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
// Execute the request
$response = curl_exec($ch);
curl_close($ch);
// Decode the response
$shortUrlResponse = json_decode($response, true);
if (isset($shortUrlResponse['shorturl'])) {
// Short URL
echo 'Short URL: ' . $shortUrlResponse['shorturl'];
} else {
// Handle error
echo 'Error: ' . $shortUrlResponse['message'];
}
} ?>
๐๐๐๐ฎ๐ณ๐ณ๐ข ๐๐๐ญ๐ก ๐๐๐ฆ๐จ๐๐๐ฅ
Hi, Jet! You requested an appointment
Appointment Date & TimeOctober 13, 2025 02:00 PM US/Pacific
Preferred Contact Method[email protected] | +14702226309
Your AddressApple Way, Marietta, GA 30066
Your notes about the project
Complaint
Our recommendation
Recommendation
After...
Would you prefer to call us now?
At Jacuzzi Bath Remodel, we know that comfort should never come at the expense of style. Thatโs why, in addition to these innovative features, we also offer an array of aesthetic elements for you to choose from to update the appearance of your bathroom. Whether you opt for a Jacuzziยฎ bathtub/shower combo or choose to replace your existing tub with a new Jacuzziยฎ walk-in shower, youโll be able to enjoy sophisticated and imaginative designs crafted from the best materials for increased beauty and durability.