Skip to content

Instantly share code, notes, and snippets.

@antxd
Created July 31, 2019 20:23
Show Gist options
  • Save antxd/d9511f5eee8f3e97b94ac671d3af64d5 to your computer and use it in GitHub Desktop.
Save antxd/d9511f5eee8f3e97b94ac671d3af64d5 to your computer and use it in GitHub Desktop.
Simple script to donwload images from array list
<?php
//https://www.sothebyshomes.com/nyc/sales/0019018
$bajar = array("https://assets.sothebyshomes.com/photos/EFF0BA8C-18D2-4DBF-8EE6-D34BE1C9E7A8_1050x700.jpg","https://assets.sothebyshomes.com/photos/533F4D9C-28C1-4155-8EFD-7F950EC095D1_1050x700.jpg","https://assets.sothebyshomes.com/photos/99D17B81-2438-4289-82F9-DFE9E97E0A8B_1050x700.jpg","https://assets.sothebyshomes.com/photos/68F769B9-8DD1-49DC-BBD9-F1BF465C474C_1050x700.jpg","https://assets.sothebyshomes.com/photos/82EFF43A-8C3B-42E8-88E8-B99E5C79484D_1050x700.jpg","https://assets.sothebyshomes.com/photos/2B428F3E-AA84-492C-BD07-E084AEFEC609_1050x700.jpg","https://assets.sothebyshomes.com/photos/FF3C7BB7-3BDF-4371-AE58-EC38176EDB38_1050x700.jpg","https://assets.sothebyshomes.com/photos/5DCCC9A2-2D38-4480-93E6-9040CF18AC01_1050x700.jpg","https://assets.sothebyshomes.com/photos/4A355387-8C9C-4A19-AE4D-4D26702511FE_1050x700.jpg","https://assets.sothebyshomes.com/photos/CC096035-0B55-4C5C-B4EF-4B3EF829A359_1050x700.jpg","https://assets.sothebyshomes.com/photos/1B8D76B8-7F0B-4612-9C6C-380D42D8B8EA_1050x700.jpg","https://assets.sothebyshomes.com/photos/81AEF76D-D8EF-4B1F-B517-EFD21E878246_1050x700.jpg","https://assets.sothebyshomes.com/photos/159602CC-A05B-4C43-81B8-9BB0475F866F_1050x700.jpg","https://assets.sothebyshomes.com/photos/01AE1299-A9A6-4F29-8AE1-D1A57C97E82B_524x700.jpg");
//https://www.sothebyshomes.com/nyc/sales/00112206-795-Fifth-Avenue-Apt-3101-New-York-NY-10065
$bajar = array("https://assets.sothebyshomes.com/photos/C612567A-9E0A-EB3E-F90C-55D9A8C44D1C_1050x700.jpg","https://assets.sothebyshomes.com/photos/A2A5061F-5FE3-6451-3A5B-3ADF8E32A3C9_1050x700.jpg","https://assets.sothebyshomes.com/photos/EC5C44A1-7140-A438-317B-3050877FC28B_1050x700.jpg","https://assets.sothebyshomes.com/photos/B8946DEC-F7E1-6920-D27B-1E08B0424462_1050x700.jpg","https://assets.sothebyshomes.com/photos/BE9FA139-7B5D-C08E-FCB7-BCD7DC56A55E_1050x700.jpg","https://assets.sothebyshomes.com/photos/5512B694-FB63-281D-55B9-3E654138CB4E_1050x700.jpg");
//https://www.sothebyshomes.com/nyc/sales/00112677-515-Park-Avenue-15-16-New-York-NY-10022
$bajar = array("https://assets.sothebyshomes.com/photos/EDBE50BC-A807-CF41-2E01-FC8318392197_1050x700.jpg","https://assets.sothebyshomes.com/photos/CA6F2975-5A77-6113-B6F6-5C9A9E0F96A6_1050x700.jpg","https://assets.sothebyshomes.com/photos/10FD7023-D89B-9BA4-FFE7-30A7502BF6B1_524x700.jpg","https://assets.sothebyshomes.com/photos/912107CC-3792-7B22-E5EE-A079B2A9C594_1050x700.jpg","https://assets.sothebyshomes.com/photos/E33D0370-5BAF-97EF-D97B-D9EB1E101F79_1050x700.jpg","https://assets.sothebyshomes.com/photos/F5648D3F-1E30-3CCF-FDF3-72FFBFACF48F_1050x700.jpg","https://assets.sothebyshomes.com/photos/B1CF31E1-D4B5-7999-885A-17437743E099_1050x700.jpg","https://assets.sothebyshomes.com/photos/9F5B2B47-2201-8C21-AD2F-F3E46D82B89D_1050x700.jpg","https://assets.sothebyshomes.com/photos/73C0397B-121E-AE48-7699-857CF5ECA196_1050x700.jpg","https://assets.sothebyshomes.com/photos/5DAC7E2A-6A2B-3024-72F6-8069A62F662F_1050x700.jpg","https://assets.sothebyshomes.com/photos/69A2EC4E-96FB-C9E6-5CAD-426FB613547E_1050x700.jpg","https://assets.sothebyshomes.com/photos/90362031-4992-DF24-0CA6-034A6DEBFC4F_1050x700.jpg","https://assets.sothebyshomes.com/photos/10865009-29B3-ECC4-A67A-4B3650129042_1050x700.jpg","https://assets.sothebyshomes.com/photos/A4E4284A-D8A5-1822-07F9-F97D9462CBDC_1050x700.jpg","https://assets.sothebyshomes.com/photos/0169119A-4459-1388-F70C-A620E4B13671_1050x700.jpg","https://assets.sothebyshomes.com/photos/FF102163-B0D9-075D-06C6-EC22B405391A_1050x700.jpg","https://assets.sothebyshomes.com/photos/CCE1104B-4765-C5C9-8A00-1E8D4AF5CB50_1050x700.jpg","https://assets.sothebyshomes.com/photos/781E2CDE-1DBE-DC1A-789E-1819702EE670_1050x700.jpg","https://assets.sothebyshomes.com/photos/1D22749B-CDED-062B-13EF-F7B1CF1E0BE5_1050x700.jpg","https://assets.sothebyshomes.com/photos/8BB83AB1-8C05-F80D-63BF-861C0A9DDA1A_1050x700.jpg","https://assets.sothebyshomes.com/photos/7FC4FEE0-5F7E-6B7A-9C2C-C87F671CAC07_524x700.jpg","https://assets.sothebyshomes.com/photos/05D4DE6E-D717-85CC-4ABD-A6E625987A2F_1050x700.jpg","https://assets.sothebyshomes.com/photos/1DDEFDB4-31B3-0847-AF5B-2DDE4E728A27_524x700.jpg","https://assets.sothebyshomes.com/photos/B04FE9C5-CC2C-F6D5-E6F6-896E3ED6798C_1050x700.jpg","https://assets.sothebyshomes.com/photos/EF810327-F1F1-09CF-2EBA-9564F109A009_1050x700.jpg");
//https://www.sothebyshomes.com/nyc/sales/00112205-795-Fifth-Avenue-30th-Fl-New-York-NY-10065
$bajar = array("https://assets.sothebyshomes.com/photos/11D26BEB-A1AD-BE3F-3586-094DD0810438_1050x700.jpg","https://assets.sothebyshomes.com/photos/08477BBA-B1D7-3D4C-FAC5-FF06D3EA8445_1050x700.jpg","https://assets.sothebyshomes.com/photos/B3C5E581-DCCF-E400-7906-F2E6EFFA3155_1050x700.jpg","https://assets.sothebyshomes.com/photos/8A0E56D8-8E38-8FC5-84A4-D920A76B8FEA_1050x700.jpg","https://assets.sothebyshomes.com/photos/A3519B1A-E1D2-7D1F-C7EA-7B5FC8650BDE_1050x700.jpg","https://assets.sothebyshomes.com/photos/0D1F0D1C-D7C9-A537-52D4-59E5622F4BF9_1050x700.jpg","https://assets.sothebyshomes.com/photos/9870B70B-9ABB-C801-5D76-BFBB8F3C7DFD_1050x700.jpg","https://assets.sothebyshomes.com/photos/BBCD91BE-D8F0-6F57-57AB-C0A523DB5A3A_1050x700.jpg","https://assets.sothebyshomes.com/photos/A60F1CB0-310A-D26A-0F31-02E3ECAFD6D9_1050x700.jpg","https://assets.sothebyshomes.com/photos/75198D79-E556-6B0C-BC59-887523BC9911_1050x700.jpg","https://assets.sothebyshomes.com/photos/4AF9FA44-920F-E257-0DB3-850BD9454F56_1050x700.jpg","https://assets.sothebyshomes.com/photos/B886F17F-EA0F-DAE5-4D12-FED77BD72058_1050x700.jpg");
//https://www.sothebyshomes.com/nyc/sales/01310600-25-Mercer-Street-PH-New-York-NY-10013
$bajar = array("https://assets.sothebyshomes.com/photos/458C124D-6213-631C-795B-8997ADCF1850_1050x700.jpg","https://assets.sothebyshomes.com/photos/3D906FAE-4FBA-EAA2-C944-913A6DCE463D_1050x700.jpg","https://assets.sothebyshomes.com/photos/6EFBE8BB-D343-7F0C-BB4E-122AE4FD0C0F_1050x700.jpg","https://assets.sothebyshomes.com/photos/594126F0-4C5F-0476-1B95-50C6ABC6480A_1050x700.jpg","https://assets.sothebyshomes.com/photos/004905CC-17C0-CFCE-2CEA-AE62B157074A_1050x700.jpg","https://assets.sothebyshomes.com/photos/3D7189A3-1177-3050-7389-F99F3C2B8EF7_1050x700.jpg","https://assets.sothebyshomes.com/photos/E7C36A98-928C-EACA-6991-1326A6B8B70B_1050x700.jpg","https://assets.sothebyshomes.com/photos/84AD4414-FFA5-17CF-F8EC-73F5316E75AB_1050x700.jpg","https://assets.sothebyshomes.com/photos/8117E418-6B2D-87BF-C54E-EE8DE1B73FAF_1050x700.jpg","https://assets.sothebyshomes.com/photos/EBC74C9A-C934-6532-C776-2E6427CA3DD5_1050x700.jpg","https://assets.sothebyshomes.com/photos/7238B09C-E8F2-BB26-1704-736EAAF60C0B_1050x700.jpg","https://assets.sothebyshomes.com/photos/911469B3-B2CE-983C-02F2-6E386DAB2B1B_1050x700.jpg","https://assets.sothebyshomes.com/photos/FB894433-4616-5ACF-7DC6-DECB78BA8D7A_1050x700.jpg","https://assets.sothebyshomes.com/photos/7B71BCCF-4711-DC7F-13C6-1EDC4D5D96EB_1050x700.jpg","https://assets.sothebyshomes.com/photos/0D1B1FDE-D4F8-996F-0C3F-485FE007BD08_1050x700.jpg");
//https://www.sothebyshomes.com/nyc/sales/00113127-1060-Fifth-Avenue-10B-New-York-NY-10128
$bajar = array("https://assets.sothebyshomes.com/photos/CFC833F9-926D-942A-0575-AF8C08B3DA14_1050x700.jpg","https://assets.sothebyshomes.com/photos/BB4FC03F-7EA0-0282-C074-FC8776D99A51_1050x700.jpg","https://assets.sothebyshomes.com/photos/A32DA129-6689-D40F-3A9C-C3D42858939E_1050x700.jpg","https://assets.sothebyshomes.com/photos/FCC509D1-4E7B-ADC1-1834-E789D9201E01_1050x700.jpg","https://assets.sothebyshomes.com/photos/1B3835FD-8767-5B9E-E921-B88DAF3F8F9D_1050x700.jpg","https://assets.sothebyshomes.com/photos/940D6E5D-01D2-7158-9872-68EDBB7A498F_1050x700.jpg","https://assets.sothebyshomes.com/photos/C5204D93-21D7-3279-9470-AE7394827202_1050x700.jpg","https://assets.sothebyshomes.com/photos/1A19E5E5-E326-20BB-F1C7-F692473BBDC6_1050x700.jpg","https://assets.sothebyshomes.com/photos/496D270F-E627-4B8A-4DEF-2BC68C3FF775_1050x700.jpg");
foreach($bajar as $image) {
$name = basename($image);
$newfile = $_SERVER['DOCUMENT_ROOT'] .'/test1/'.$name;
if(copy($image, $newfile)){
echo 'Successfully downloaded '. $image;
}else{
echo 'Download failed for '. $image;
}
}
?>
<script type="text/javascript">
/*
var arrphp;
$('.slider li').each(function(){
phrase = $(this).find('img').attr('src');
arrphp += '"'+phrase+'",';
})
console.log(arrphp)
*/
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment