[ overboard / sfw / alt / cytube] [ leftypol / b / WRK / hobby / tech / edu / ga / ent / 777 / posad / i / a / R9K / dead ] [ meta ]

/tech/ - Technology

"Technology reveals the active relation of man to nature"
Name
Email
Subject
Comment
Captcha
Tor Only

Flag
File
Embed
Password (For file deletion.)

Matrix   IRC Chat   Mumble   Telegram   Discord


File: 1608526088541.png ( 368.59 KB , 680x838 , dangerously based.png )

 No.3025[View All]

I've decided to make my script open source. Enjoy.
https://pastebin.com/raw/pajZ4N2x

Edit: This script has been banned on leftypol, hobby, tech, edu, games, gulag and anime. But you can still post with it in this thread, I guess.
255 posts and 98 image replies omitted. Click reply to view.
>>

 No.4411

>>4402
moron
>>

 No.4414

File: 1608526227127.jpg ( 27.53 KB , 460x369 , t.jpg )

>4939
>>

 No.4418

how tf does this work on 4chan? :]
>>

 No.4419

>>4418
Click wojakify, and post without an image. If posting takes slightly longer as if you added an image, that means the wojak has been added.
>>

 No.4420

>>4419
No what I mean, is thst the Wojackify button does not show up. It works fine on this board but not 4chan. Maybe because I am on mobile atm?
>>

 No.4421

>>4420
I experienced issues with mobile browsers as well. I have to set up an android VM where I'll find out what's wrong. Currently, only desktops are supported, but maybe try forcing the desktop version of 4chan?
>>

 No.4422

>>4421
The mobile version of 4chan uses almost entirely different code to display
>>

 No.4423

>>4422
That explains why wojakify buttons aren't visible. I've managed to reproduce the bug with ctrl + scroll up. If the script works, using it from the desktop version should be possible.
>>

 No.4424

>>3025
Does anyone know of a way to use the clipboard to upload files?

I hate having to save shitposts on my computer to then upload them here. I'd much rather just use the clipboard. Does anyone know of a plugin that allows this feature?

I'm using firefox btw.
>>

 No.4425

The 4chan mobile issue >>4420 is that addWojakifyButtons in platform/4chan.js adds the button to each querySelectorAll(".postInfo") but there are two info divs per div.post.reply: div.postInfoM.mobile and div.postInfo.desktop, and only the former shows on mobile. You can either add two buttons, such as with querySelectorAll(".postInfo, .postInfoM"), or add the button one level higher.
>>

 No.4426

And I have a question about the design of your createWojakifyButton and callback. The function that is set as button.onclick already uses callback from its closure. What is the point of constructing a new callback for each createWojakifyButton solely to capture the post id? If you simply pass the callback arguments, such as [id], to createWojakifyButton you can give them to callback in button.onclick and use exactly the same callback for each button, without creating a new one per-button. You currently have two levels of capture, one in the callback constructor for id and one in button.onclick for callback. If you flatten the two levels by using both callback and its arguments in button.onclick, you eliminate the need for per-button callback construction.
>>

 No.4427

File: 1608526228327.jpg ( 8.94 KB , 246x205 , swag.jpg )

Holy /v/ermin.
>>

 No.4428

>>4426
On most platforms, an arrow function is used with createWojakifyButton that captures everything it needs. It was like this originally on 4chan platform as well. The most minimal wojakify handler for text mode is

Id and seetheModeCheckbox is already captured by the closure, it's too simple to become it's own named function, and I'd rather avoid parsing posts when it's not necessary. Passing constant values as arguments wouldn't improve anything. The way I did it on other platforms is basically instead of creating callbacks for each button for each post, I create a wrapper of createWojakifyButton that passes an arrow function as the callback that captures the id. I think I'll do something similar on 4chan as well.
>>

 No.4429

>>4428
>Passing constant values as arguments wouldn't improve anything.
Of course it would. Right now you have: capture args and create no-arg function, capture this no-arg function, call this no-arg function. The result is that every invocation of createWojakifyButton in every *-common.ts file is given a freshly constructed no-arg arrow function for that button. By contrast, if you switch to >>4426 you would have: capture function and args, call function with those args. This way every invocation of createWojakifyButton for a platform could receive exactly the same callback function, only the args to be used by button.onclick would differ.

>The way I did it on other platforms is basically instead of creating callbacks for each button for each post, I create a wrapper of createWojakifyButton that passes an arrow function as the callback that captures the id.

But the "instead of creating callbacks for each button for each post" is exactly what is verifiably false. Right now you are creating a new callback for each button in each invocation of createWojakifyButton in *-common.ts. This is what >>4426 would eliminate.

From vichan-common.ts:

protected createImageWojakifyButton(id: string, nth: number) {
return createWojakifyButton('wojakify-image', 'Wojakify Image', () => {
generateImageWojak(this.accessor.getPostImageURL(id, nth), options[this.sojakSelector.value]).then(wojak => this.handleWojakify(wojak, id));
});
}

That creates a fresh callback for each button.
>>

 No.4432

>>4429
Alright, I get it now. createWojakifyButton will now capture constant arguments to the callback. I had to use bind to properly capture this value for methods.
https://github.com/Wojakposter/Wojakificator/commit/86d7dc06bf9ac474c3a5e82d0912e868ddf36db7
>>

 No.4434

>>4432
moron
>>

 No.4436

>>4432
>src/ui.ts
>export const createWojakifyButton = (buttonClass: string, name: string, callback: (…args: any[]) => void, …args: any[]) => {
>callback(…args);

This is great, thank you. And I see you added 4chan mobile as well.
>>

 No.4443

File: 1608526229750.png ( 265.77 KB , 785x1009 , (you).png )

>>

 No.4445

It seems that createUI in *-common.ts uses the hardcoded options from options as an argument to createSelect from ui. But createSelect uses localStorage to set and retrieve the previousSelection value. So it seems options could be turned into a dictionary mapping image set names to image dictionaries and localStorage could be used to select and remember the image set name.
>>

 No.4446

>>4445
Yes, I considered this as well. The question isn't how to add image sets, the question is if I should add image sets. Is there a large enough amount of images that adding them would be an improvement? How would adding them affect the time spent on selecting wojaks?
>>

 No.4451

>>4446
Your script is a generated image poster and jackposting is simply the only currently implemented reaction type. By adding support for image sets you would expand the usefulness of your script to a larger audience, since there are those of us who do not care for jackposting specifically. Expanding the usefulness of your script to a larger audience seems like a much better metric of whether there "would be an improvement" than "is there a large enough amount of images". Eight have been posted >>4233 for bootstrapping a yuri set but image set support is not specific to yuri. The effect on "the time spent on selecting wojaks" would be zero for those who only post jacks, which is currently your entire userbase. After an initial phase of curiosity most people would settle on one image set and use that, so the selection time would be as it is now. In >>4219 you said
>I'll implement iamge sets after I finish implementing the 4chan platform.
and no "question […] if I should add image sets" was included. Of course since this is your script and you're the one doing the actual programming you should work on whatever feature you want to work on.
>>

 No.4452

>>4451
So far no one posted any ideas for an alternative image set that is worth implementing. Yuri doesn't fit the 'post a reaction face and quote the whole post' pattern, which is why I won't add it to this script. Unless you post something worth implementing, I won't waste disk space of the script's users.
>>

 No.4453

>>4452
To help us guess what you consider "something worth implementing" it would be very helpful if you shared with us what caused the drastic change from the unambiguous "I'll implement iamge sets after I finish implementing the 4chan platform" >>4219 in response to a post >>4218 that didn't even include any images, to your current stance of equating not adding a particular set, yuri, with not adding generic image set support at all, since you already said you would add it back when no images were linked.
>>

 No.4454

File: 1608526230800-0.png ( 332.96 KB , 716x851 , 4e923faf788fe8ceae94f94a06….png )

File: 1608526230800-2.jpg ( 1.7 MB , 1200x1200 , 1492651083644.jpg )

Add these if they're not already there
>>

 No.4460

>>4453
Alright, I'm done talking to you. If you want 'image sets', make a fork and implement them yourself.
>>

 No.4461

File: 1608526231845.png ( 455.65 KB , 1024x1211 , (you).png )

>>

 No.4462

soyjak.party support when?
>>

 No.4463

File: 1608526232148.png ( 253.62 KB , 1122x1210 , gnutard.png )

>>4461
>NOOOOOOOOOOOOOOOOOOOOOOO YOU CAN'T JUST REJECT MY FEATURINO REQUEST YOU HAVE TO DO WHAT I WANT NOOOOOOOOOOO
>>

 No.4464

>>4460
moron
>>

 No.4472

Automating /v/-tier retardation.
>>

 No.4480

I think bunkerchan is clearly, very cucked, what a shame, for a board that didn't seem like shit… (let me post from Tor!)
>>

 No.4481

>>4480
lmao it let me post from tor
>>

 No.4491

File: 1608526235722.png ( 344.37 KB , 785x1293 , (you).png )

>>

 No.4552

File: 1608526242986.png ( 171.51 KB , 599x740 , Pol SSeethe.png )

>>

 No.4586

I see that the post consisting entirely of "Stay classy, my friend. Stay classy." and this worksafe image https://gelbooru.com/index.php?page=post&s=view&id=3491125 in response to >>4460 was quietly removed, while a series of posts like >>4464 is no problem.

Stay classy, admins. Stay classy.
>>

 No.4794

File: 1608526269992.png ( 408.59 KB , 656x979 , d4ec685edffbf585351df94335….png )

add
>>

 No.4799

>>

 No.4804

File: 1608526271141.png ( 195.93 KB , 820x986 , (you).png )

>>

 No.4827

OP can you add a back massager button for when my back hurts
>>

 No.5096

Is this thing over, OP? Script needs some burger election edits.
>>

 No.8410

Classic thread
>>

 No.8469

Can this be used over TOR on the bunkerchan onion
>>

 No.10890

Gem
Someone remake this shit
>>

 No.10891

I miss bunkerchan bros…
>>

 No.10892

>>10891
go back
i wish
>>

 No.10936

>>10891
This is bunkerchan in all but name
>>

 No.10988

Make pls
>>

 No.10989

Yeap
>>

 No.11092

File: 1658308826614.gif ( 1.05 MB , 498x498 , cow.gif )

>make fun novelty
>mods kill its use
>>

 No.11093

>>11092
You can post wojacks here

Unique IPs: 8

[Return][Catalog][Top][Home][Post a Reply]
Delete Post [ ]
[ overboard / sfw / alt / cytube] [ leftypol / b / WRK / hobby / tech / edu / ga / ent / 777 / posad / i / a / R9K / dead ] [ meta ]
ReturnCatalogTopBottomHome