[ om / jp / 2d ] [ home ]

/jp/ - 2D/Random

Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1628146707279.jpg (244.84 KB, 1333x1000, sample-1b8b6d6912b41c3a729….jpg)

No. 544243

Content in next post

No.544244

File: 1628147439143.png (925.76 KB, 1904x979, 2021-08-05-024344_1904x979….png)

I don't know shit about javascript and I wrote this in the past few hours.

I bruteforced it by googling how to do everything I wanted in javascript (sleep() does not exist for some reason)

I do understand everything in this script currently except "spread syntax" (line 11) which I don't get.

Anyway mass downloading from Sankaku Complex is very hard, the links are only in the HTML via javascript when you scroll through search results, and it unloads the old links as you keep scrolling.

So this script runs a function every 5 seconds that gets all the links currently loaded

Basically, I can run the script, and manually start scrolling through search results, and it collects all the links as I scroll the page into an array.

Now I just need to work on somehow downloading the images from each of those links.

No.544245

uguu

No.544246

normkaku complex

No.544247

sleep is simple to write

const sleep = async (ms) => new Promise(res => setTimeout(res, ms))
await sleep(1000);


spread operator just unpacks an iterable into a varargs method, but that might only make sense if you've run into variadic args in another language like c++ or python.

it might be easiest to just have your script output just the urls and download them with curl or wget or Invoke-WebRequest

No.544248

File: 1628148973154.jpg (194.85 KB, 1200x1096, 1627976718739.jpg)

>>544247
Yeah I found that method of implementing sleep(), and it just seems to be broken with how my function worked.

I just want to run a function at a set interval until I tell it to stop (preferably I could get this bound to a key or button), which I realized I could just be doing in other ways like window.setInveral

No.544250

>>544248
you can only call async functions from async functions, so you'd have to make your function async and then call it with "await"

No.544251

>>544250
Yeah I did that, it just actually wouldn't work properly. It would just stop sleeping after 2 or 3 times and idk why. Already deleted that code and decided I shouldn't use js's ghetto version of sleep in the first place.

No.544253

wish i was an elite supercoder like whatmin and pissmin

No.544255

>>544253
both will die virgins

No.544256

>>544255
So will you and I

No.544259

henri is my friend

No.544260

bugsnax is my friend

No.544263

File: 1628178330192.jpeg (274.26 KB, 2048x969, snax.jpeg)


No.544264

>>544263
my friends are here

No.544273

fartman is my friend

No.544274

>>544263
bugsnax

No.544280

fartman

No.544284

>>544273
Go back to fartchan then.

No.544285

bugsnax

No.544287

File: 1628199149143.jpg (174.15 KB, 611x521, 76ed6bd19d287da154dd396083….jpg)


No.544291

>>544284
BBBBBBBRRRRRRAAAAAPPP!

No.544292

>>544291
the hima howl of celibacy

No.544309

>>544284
who's fartchan?



Delete Post [ ]
[Return]
[ om / jp / 2d ] [ home ]