Skip to content

Commit 6a5953b

Browse files
Web page downloader
Uses the standard libraries in c
1 parent 1e23483 commit 6a5953b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

webPageDownloader.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <stdio.h>
2+
#include <string.h>
3+
4+
/*English is not my main language. If you notice something wrong, please modify it. It's everyone's code ;)*/
5+
6+
char url[1024];
7+
char command[1043];
8+
char hyperlinks[3];
9+
10+
int main(void){
11+
/*The url to be downloaded and the number of web pages directly related to be downloaded*/
12+
printf("Please enter the name of the webpage you want to download\n");
13+
scanf("%s\n", url);
14+
printf("Enter the number of web pages directly related to the web page to be downloaded (enter a number between 0 and 999. if you want all the related web pages, type 'inf' without the quotes");
15+
/*Sorry for this last line, Geany IDE doesn't like to printf in two lines*/
16+
scanf("%s\n", hyperlinks);
17+
18+
/*Concatenate the strings*/
19+
strcpy(command, "wget -r -l ");
20+
strcat(command, hyperlinks);
21+
strcat(command, " ");
22+
strcat(command, url);
23+
24+
system(command);
25+
}

0 commit comments

Comments
 (0)