>make 4chan picture downloader in C#
>application is 'not responding' while downloading the pictures
how do I make it that the application stays responsive at all times /g/?
Have the downloading be done in another thread
>>59427375
>One process, several threads
Download on something other than the UI thread.
https://www.google.com/search?q=C%23+threading
>>59427388
>>59427392
>>59427393
thanks /g/uys, will try it out.
>>59427375
Didn't you pass 1st year CS?
>>59427375
Task.WhenAll() is your friend
Async.
>>59427375
Another thread you dumb Pajeet
>>59427375
How the fuck is it possible that you dont know about threads?
dumb winbabby4dl() {
board="$(printf -- '%s' "${1:?}" | cut -d '/' -f4)"
thread="$(printf -- '%s' "${1:?}" | cut -d '/' -f6)"
wget -qO- "https://a.4cdn.org/${board}/thread/${thread}.json" | jq -r '
.posts
| map(select(.tim != null))
| map((.tim | tostring) + .ext)
| map("https://i.4cdn.org/'"${board}"'/"+.)[]
' | xargs wget -U 'Mozilla/5.0' -nv
}
requires jq as a small dependency
>>59427375
... why? for the challenge?
Firefox + img2tab does the job just fine
>>59428490
>>59428603
I didn't study CS, I'm just doing it for the fun.
>>59428638
I don't care about your shit using the 4chan api
>>59428661
yes I wanted to see how hard it was to make a little gui application in C# that would download the pictures in a thread
>>59428603
I'm a 4th year "CS" student and 9/10 of my classes were beginners courses in various languages. C, Cpp, Java, Javascript, Python, C#. I simply only know basics and they give me a degree next month.
I wouldn't have fallen for the uni meme if I didn't get a full ride.
>>59427375
If you have 4chan x this is already possible. You just need to expand all images in the thread and then press ctrl+s to save the webpage. All images will appear in the webpage folder
>>59428686
>not using the api
>being a contrarian fag just because
fuck off
>>59429012
modern programmers are faggots. too lazy or stupid to do their own so they use frameworks and paste from stackoverflow
>>59427375
>uses C#
>doesn't even know about async await
>>59429012
I asked for advice on howto improve my C# program, not some shitty bash trash so you can fuck off to your own thread.