/tech/ - Tech


Mode: Reply

Max message length: 8192


Max file size: 80.00 MB

Max files: 5


(used to delete files and postings)


Remember to follow the rules

(368.59 KB 680x838 dangerously based.png)
Bunkerchan wojak generator script Wojakposter 07/11/2020 (Sat) 05:26:25 No. 3212
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.
Edited last time by caballo on 07/29/2020 (Wed) 23:16:21.
>>4913 >>4912 morons
(143.63 KB 800x598 (you).png)
New version: 1.11.0 https://github.com/Wojakposter/Wojakificator/releases/tag/v1.11.0 Added stalin soyjak( >>4912 ). Added support for crystal.cafe and wirechan.
(635.07 KB 642x642 dungoidsoyjack.png)
>>4923 add this
>>4928 that stalin soyjack could be better if you ask me. I made it while totally shitfaced. might remake it later
>>4930 Sure.
>>4922 moron
(27.53 KB 460x369 t.jpg)
how tf does this work on 4chan? :]
>>4956 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.
>>4957 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?
>>4958 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?
>>4959 The mobile version of 4chan uses almost entirely different code to display
>>4960 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.
>>3212 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 >>4958 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.
(8.94 KB 246x205 swag.jpg)
Holy /v/ermin.
>>4966 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 javascript () => generateTextWojak(getPostText(id), seetheModeCheckbox.checked).then(handleWojakify); 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.
>>4968 >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 >>4966 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 >>4966 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.
>>4969 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
>>4972 moron
>>4972 >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.
(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.
>>4990 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?
>>4991 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 >>4605 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 >>4584 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.
>>4996 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.
>>4997 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" >>4584 in response to a post >>4583 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.
Add these if they're not already there
>>4998 Alright, I'm done talking to you. If you want 'image sets', make a fork and implement them yourself.
(455.65 KB 1024x1211 (you).png)
soyjak.party support when?
(253.62 KB 1122x1210 gnutard.png)
>>5005 moron
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!)
>>5036 lmao it let me post from tor
(344.37 KB 785x1293 (you).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 >>5005 was quietly removed, while a series of posts like >>5010 is no problem. Stay classy, admins. Stay classy.
(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.
(220.50 KB 360x450 Jar_Jar_SWSB.png)


no cookies?