[ 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"
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.

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.




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



how tf does this work on 4chan? :]


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 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?


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?


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


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.


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.


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.


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.


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

Holy /v/ermin.


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.


>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.


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.




>export const createWojakifyButton = (buttonClass: string, name: string, callback: (…args: any[]) => void, …args: any[]) => {

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


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



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.


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?


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.


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.


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.


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


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


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



soyjak.party support when?


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





Automating /v/-tier retardation.


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


lmao it let me post from tor


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



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



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.


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





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



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


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


Classic thread


Can this be used over TOR on the bunkerchan onion


Someone remake this shit


I miss bunkerchan bros…


go back
i wish


This is bunkerchan in all but name


Make pls




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

>make fun novelty
>mods kill its use


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 ]