0

Hey I was wondering how to download images through code, I am familiar with C++, java, and just started javascript and HTML.

I am trying to download this image from:

http://wallbase.cc/wallpaper/335950

a similar question was this link:

https://stackoverflow.com/a/10443205/983292

but I dont understand it, if anyone can explain that, maybe it can help me. (side note looking through the source code of the wallbase website it seems like the question I linked to is trying to do the same thing)

Thanks in advance!

Community
  • 1
  • 1
Kayvan
  • 1
  • 1
  • which programming language are you using? – Sree Jul 17 '12 at 06:25
  • What don't you understand? What have you tried? – Shannon Matthews Jul 17 '12 at 06:31
  • @sreehari I haven't tried anything I don't really understand web programming. – Kayvan Jul 18 '12 at 19:08
  • @Shannon I just don't understand # get all pages curl 'http://domain.com/id/[1-151468]' -o '#1.html' # get all images grep -oh 'http://pics.domain.com/pics/original/.*jpg' *.html >urls.txt # download all images sort -u urls.txt | wget -i- I know it has comments on what the commands do but what are the flags and such, and to answer your other question to be honest I haven't really tried anything I am new to web programming as mentioned above. – Kayvan Jul 18 '12 at 19:11
  • @kayvan: Your question is too broad. There could be any number of things you don't understand about the linked question. You are more likely to receive a useful response if you ask a question about a specific problem. If you don't understand what the flags mean, that's the question you should ask. – Shannon Matthews Jul 19 '12 at 05:24

1 Answers1

0

In c use this code: Download file using libcurl in C/C++

You need to install libcurl3-dev or libcurl4-dev to get the header files associated with the library.

When compiling, you should pass $(pkg-config --cflags libcurl) to gcc. When linking, $(pkg-config --libs libcurl). If you are compiling and linking in one step you can do it like so:

gcc myfile.c $(pkg-config --libs --cflags libcurl) -o myprogram

Hope this helps.

Community
  • 1
  • 1
JMBise
  • 680
  • 4
  • 19