Início > Diversos > Downloading web pages using C/C++ and wget

Downloading web pages using C/C++ and wget

Browsing around the Internet, I found this website here http://www.youngprogrammer.com/acmhome.php?page=1 where you can find loads of UVA’s problems solved! The thing is, there where too many of them and download them one by one would be extremely annoying and a waste of time. So, I decided to write a program to deal with that and get all of the programs in seconds!

All you need to have is a C/C++ compiler and the wget software.

If you see the first page on this post, you’ll note that the URL’s codes keeps repeating a pattern. All of them look like this:

http://www.youngprogrammer.com/cpp/NUMBERHERE.cpp

So, all we have to do is to write a program that iterates through “NUMBERHERE”. The code below does that:

Code

Of course, that kind of code only works when you have a good URL pattern. Otherwise, it doesn’t help much…

I hope you like it! As always, comments are very welcomed! 😀

PS: If you detected some mistake on any part of my post or in my English, please, send me an email or a comment correcting me! I’m Brazilian, so I’m not an English native speaker. I would really appreciate being corrected! Thank you in advance! 🙂

Anúncios
Categorias:Diversos
  1. Nenhum comentário ainda.
  1. No trackbacks yet.

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair /  Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair /  Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair /  Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair /  Alterar )

w

Conectando a %s

%d blogueiros gostam disto: