( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<!--curl "https://pixelied.com/api/templates/6463839a2b7398015efc9900" ^
"authority: pixelied.com" ^
"accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" ^
"accept-language: en-US,en;q=0.9,la;q=0.8,da;q=0.7" ^
"cache-control: max-age=0" ^
"cookie: G_ENABLED_IDPS=google" ^
"dnt: 1" ^
"if-none-match: W/^\^"4c07-k7Hh1BfPlrbxi+lDJKMOF9D5OR0^\^"" ^
"sec-ch-ua: ^\^"Chromium^\^";v=^\^"116^\^", ^\^"Not)A;Brand^\^";v=^\^"24^\^", ^\^"Google Chrome^\^";v=^\^"116^\^"" ^
"sec-ch-ua-mobile: ?1" ^
"sec-ch-ua-platform: ^\^"Android^\^"" ^
"sec-fetch-dest: document" ^
"sec-fetch-mode: navigate" ^
"sec-fetch-site: none" ^
"sec-fetch-user: ?1" ^
"upgrade-insecure-requests: 1" ^
"user-agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36" ^
--compressed--><?php
include('Connections/videoondemand.php');
require("DbSql2.inc.php");
require("NewsSql2.inc.php");
$db = new NewsSQL;
//a class to handle database operations
ini_set('max_execution_time', 30000000); //300 seconds = 5 minutes
error_reporting(1);
function downloadFile($url, $path)
{
$newfname = $path;
$file = fopen ($url, 'rb');
if ($file) {
$newf = fopen ($newfname, 'wb');
if ($newf) {
while(!feof($file)) {
fwrite($newf, fread($file, 1024 * 8), 1024 * 8);
}
}
}
if ($file) {
fclose($file);
}
if ($newf) {
fclose($newf);
}
}
$json = '[{"_id":"650856afd059a062d347fade","template_lang":"en","pages":[{"page_id":"b3cd1511-c1ff-4df3-81e4-ba853d4cb992","page_name":"","is_pro":true}],"is_pro":false,"is_published":true,"tags":["transportation","ecommerce","sports","fitness","sports & fitness","car","auto","car & auto","bike","transport","vehicle","motorbike","motorcycle","heavy","suzuki","hayabusa","model","stylish","style","red","bold","engine","features","automatic","metallic","quality","expensive","fresh","new","launch","typography","shine","design:image"],"template_name":"Suzuki Hayabusa","template_desc":"Suzuki hayabusa","user_id":"6390e66e91323c3a7453e185","format_category":"facebook-post","canvas_doc_json":{"doc_width":940,"doc_height":788,"doc_units":"px","editor_json_url":"https://design-files.pixelied.com/files/6840c775-4f61-4a1b-8cbb-b11367a41ec0.txt","editor_json_uuid":"6840c775-4f61-4a1b-8cbb-b11367a41ec0"},"type":{"parent_type":"social-media","group":"Facebook","platform":"Facebook"},"created_at":"2023-09-18T13:54:55.686Z","updated_at":"2023-09-18T13:54:55.686Z","thumbnail_url":"https://cdn.pixelied.com/thumbnails/01a2f6e1-e55d-4fa9-ae47-d4d5dd90211d.jpeg?ts=1695045295946","thumbnail_width":550,"thumbnail_height":461,"thumbnail_size":41878,"__v":0},{"_id":"650851b160f8307acf6ad315","template_lang":"en","pages":[{"page_id":"e60e4c00-a8f6-44c9-b97b-d39efcb5027d","page_name":"","is_pro":true}],"is_pro":false,"is_published":true,"tags":["sports","fitness","sports & fitness","ecommerce","medical","pharmaceutical","medical & pharmaceutical","body","weight","scale","machine","digital","backlit","light","number","glass","slim","sleek","product","green","simple","feature","pounds","kg","measure","feet","foot","legs","person","design:image"],"template_name":"Digital Body Weight Scale","template_desc":"Digital body weight scale","user_id":"6390e66e91323c3a7453e185","format_category":"facebook-post","canvas_doc_json":{"doc_width":940,"doc_height":788,"doc_units":"px","editor_json_url":"https://design-files.pixelied.com/files/8f422c22-b0ae-4998-ad85-c8c28fc2bc4b.txt","editor_json_uuid":"8f422c22-b0ae-4998-ad85-c8c28fc2bc4b"},"type":{"parent_type":"social-media","group":"Facebook","platform":"Facebook"},"created_at":"2023-09-18T13:33:37.083Z","updated_at":"2023-09-18T13:33:37.083Z","thumbnail_url":"https://cdn.pixelied.com/thumbnails/8e8f6548-b8f0-40a7-a2a1-00c9e619951e.jpeg?ts=1695044017280","thumbnail_width":550,"thumbnail_height":461,"thumbnail_size":28276,"__v":0}]';
include("assets/newtemplates2.php");
$data = json_decode($json , true);
$count = -1;
$specialID = 16000;
foreach ($data[0]["templates"]as $row) {
$count++;
$specialID++;
if($count > 1 && $count < 7500) {
$id = $row['_id'];
$jsonX ="https://pixelied.com/api/templates/$id";
$file_name2 = basename($jsonX);
$destinationFilePath2 = "/var/www/html/assets/newDesigns2/$file_name2.json";
if (!file_exists($destinationFilePath2)) {
//download json
$file_name2 = basename($jsonX);
$destinationFilePath2 = "/var/www/html/assets/newDesigns2/$file_name2.json";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "$jsonX",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authority: pixelied.com",
"accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language: en-US,en;q=0.9,la;q=0.8,da;q=0.7",
"cache-control: max-age=0",
"cookie: G_ENABLED_IDPS=google",
"dnt: 1",
"sec-fetch-dest: document",
"sec-fetch-mode: navigate",
"sec-fetch-site: none",
"sec-fetch-user: ?1",
"upgrade-insecure-requests: 1",
"user-agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36",
),
));
$response = curl_exec($curl);
curl_close($curl);
$file = fopen($destinationFilePath2, 'w+');
fputs($file, $response);
fclose($file);
echo "$specialID - downloaded ".$jsonX."<br>";
}
else {
// echo "$specialID -Already downloaded ".$jsonX."<br>";
}
}
}