LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-02-2007, 03:45 PM   #1
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Rep: Reputation: 30
Using WGET to download specific filetype


Hello...nvm

Last edited by itz2000; 11-10-2010 at 05:54 PM.
 
Old 02-02-2007, 04:32 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
Have a look at man wget for the -A option. There are examples using -A.gif and -A "*.gif" that do pretty much what you're asking for...
 
Old 02-02-2007, 08:27 PM   #3
tsunami_imcool
Member
 
Registered: Mar 2005
Distribution: Debian
Posts: 80

Rep: Reputation: 15
have you tried
wget http://www.somesite/folder/*.pdf
with the wild-card in there? thats what i'd try
 
Old 02-03-2007, 05:49 AM   #4
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Original Poster
Rep: Reputation: 30
Thanks

Thanks, Actually... written a script that does that, here it is in case you want to use it one day :

Code:
#!/bin/bash


function usage()
{
	echo $0 " delimiter website_adress filetype";
echo "       delimiter - (number, 6 is good for default apache, try less for iis)";
echo "       filetype - e.g pdf, zip ";
echo " ";
echo "     Example usage : "$0" 6 http://www.ebooks.com/insiderfolder pdf";
}
if [ $# -ne 3 ]; then
	usage;
	exit 1;
else
	echo "var is okay";
fi

delimiter=$1;
default=index.html;
website=$2;
filetype=$3;
folder=tmp;
mkdir $folder && cd $folder;

wget $website;#`echo /$default`;
cat $default | sed 's@.*href="(.*)".*@1@g' | cut -d '"' -f $delimiter | grep $filetype > tmplist;
for file in $(cat tmplist); do
	wget $website`echo /$file`;
	mv $file ../;
done

Last edited by itz2000; 11-10-2010 at 05:55 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
wget and slackware download ivanatora Slackware 4 01-12-2008 06:12 AM
large download with wget -c michapma Linux - Software 4 07-20-2006 06:12 AM
Automated download sorting by filetype General Linux - Software 1 04-30-2006 12:50 AM
Prevent a specific filetype from being created? Phaethar Linux - Security 0 02-17-2005 12:49 PM
what to do with 5 parts of wget download Bruce Hill Linux - Software 2 09-11-2003 11:47 AM


All times are GMT -5. The time now is 04:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration