Search Google

Sunday 17 August 2014

how to download image from websites directory

wget -r -A=.jpg,.png http://website.com
 
With this command you will get all the JPG and PNG files, but you can get banned from the site.
So, if you use:

wget --random-wait --limit-rate=100k -r -A=.jpg,.png http://website.com
 
You'll get your images waiting a random time between downloads and setting a speed limit.

Zip a folder on the server with php

<?php
open('myZip.zip', ZIPARCHIVE::CREATE) !== TRUE) 
{
 die ("Could not open archive");
}
// initialize an iterator
// pass it the directory to be processed
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator("$dir/"));
// iterate over the directory
// add each file found to the archive
foreach ($iterator as $key=&gt;$value) 
{
 $zip-&gt;addFile(realpath($key), $key) or die ("ERROR: Could not add file: $key");
}

// close and save archive
$zip-&gt;close();
echo "Archive created successfully. <a href="myZip.zip" rel="nofollow">click to download</a>";
?>

 


With Linux it's pretty easy. Not sure about windows.
wget -H -r --level=1 -k -p http://www.site.com/path/to/images
 
 

Mobile Verification 1.0

Mobile Verification takes a mobile phone number and generate a 9 digit verification code. The generated code gets returned as a string.

Requirements:
PHP 5.0 or higher
- See more at: http://www.phpkode.com/scripts/item/mobile-verification/#sthash.PBz9xQSV.dpuf
 

Mobile Verification 1.0

Mobile Verification takes a mobile phone number and generate a 9 digit verification code. The generated code gets returned as a string.

Requirements:
PHP 5.0 or higher
- See more at: http://www.phpkode.com/scripts/item/mobile-verification/#sthash.PBz9xQSV.dpuf

1. Download Single File with wget

The following example downloads a single file from internet and stores in the current directory.
$ wget http://www.openss7.org/repos/tarballs/strx25-0.9.2.1.tar.bz2 While downloading it will show a progress bar with the following information:
  • %age of download completion (for e.g. 31% as shown below)
  • Total amount of bytes downloaded so far (for e.g. 1,213,592 bytes as shown below)
  • Current download speed (for e.g. 68.2K/s as shown below)
  • Remaining time to download (for e.g. eta 34 seconds as shown below)
Download in progress:
$ wget http://www.openss7.org/repos/tarballs/strx25-0.9.2.1.tar.bz2 Saving to: `strx25-0.9.2.1.tar.bz2.1' 31% [=================> 1,213,592 68.2K/s eta 34s Download completed:
http://mashable.com/2007/07/31/firefox-http://mashable.com/2007/07/31/firefox-down  

 

No comments:

Post a Comment