« first day (349 days earlier)      last day (1075 days later) » 

12:01 AM
I am working with user-script but I see it does not work;
(function() {
  // Wait until page be ready (Document Ready).
  document.addEventListener('DOMContentLoaded', (event) => {
    document.querySelector(".fs-fine tt-uppercase ml8 mt24 mb4 fc-light").style.display = "none";
})
})();
 
12:24 AM
@KevinM.Mansour Does it work if you put it directly into the console?
 
@Scratte No It says undefined
 
".fs-fine tt-uppercase ml8 mt24 mb4 fc-light" does not look right
the . means a class
 
@Scratte When I run only document.querySelector(".fs-fine tt-uppercase ml8 mt24 mb4 fc-light").style.display = "none";
Uncaught TypeError: Cannot read property 'style' of null
    at <anonymous>:1:74
@Scratte But it is actually class.
 
it there are more than one class for an element, they have to have a . for each one
try with dots on all of them: .fs-fine.tt-uppercase.ml8.mt24.mb4.fc-light
When I try JavaScript, I use console.log a lot.. really a lot.
Like this:
 
@Scratte Wow; works only in console;
when I use it like this id does not work
(function() {
  // Wait until page be ready (Document Ready).
  document.addEventListener('DOMContentLoaded', (event) => {
    document.querySelector(".fs-fine.tt-uppercase.ml8.mt24.mb4.fc-light").style.display = "none";
})
})();
 
12:29 AM
var myElement = document.querySelector("....");
console.log(myElement);
 
@Scratte Finnay it works great; like this :
(function() {
  // Wait until page be ready (Document Ready).
    document.querySelector(".fs-fine.tt-uppercase.ml8.mt24.mb4.fc-light").style.display = "none";

})();
 
@KevinM.Mansour That is a timing issue.. it happens a lot. The page is loaded, but there are still elements that have not yet been added to the page.
 
@Scratte Thanks for help;
 
No problem :) That was easy :)
 
@Scratte :)
 
12:30 AM
What do you want to hide? :)
 
@Scratte This
@Scratte Content I do not use;
 
I see. I use uBlock for that :) When it's just a static element. I hide all kinds of stuff with that. It's an extension. It's called "uBlock Origin". There's another uBlock, but don't use that. They had some privacy issues.
 
@Scratte I have fun by writing my custom JS while I faced a lot of issues; I having fun with that, anyway I will try that extension for other sites no Stack.
@Scratte Is I will get suspended for making user-script like that or that fine.
 
@KevinM.Mansour That is fine :) You can hide everything you like :)
 
@Scratte OK Thanks :)
Thanks for help;
 
12:36 AM
You don't get suspended for changing the way the user interface is displayed to you :)
 
@Scratte I am just make sure everything is fine.
 
You can get in trouble if you try a DDoS attack :P
@KevinM.Mansour That's completely fine. There's no problem with doing that :)
I noticed you posted the message in both the other room and this room. You should pick only one room to post a message and then be patient :)
 
@Scratte :) No I won't try that anyway, I do not know cypersecurity attack.
 
@KevinM.Mansour I accidentally did one. But I was rate limited pretty fast. Then I couldn't load any pages on Stack for a while :D
 
@Scratte I posted there and I just fined that room is more familiar with user-script then I went to another room but I noticed time is out;
 
12:39 AM
@KevinM.Mansour I see. I will reply to you in the other room.. but only so other users will not also try to help you with the same thing. You do not need to reply to me there :)
 
@Scratte accidentally or you was trying to play with Stack Overflow;
 
@Scratte thankfully, not needed :) Most of the more modern APIs are promise-based automatically, so you can either use async/await or chain with then/catch
 
@Scratte OK
 
@KevinM.Mansour No, not trying to play. I was creating a callback and it went into an endless loop :(
@OlegValter That is with pure JavaScript fetch, no? No jQuery?
 
@Scratte by using promise-based APIs, you can achieve the same effect (when you await or chain a promise with then, what comes after or as a callback for then is fired only after the promise resolves). But promises is a whole other topic (not sure if Java has a similar feature - I guess it should have)
@Scratte yup, pure :) For example, this is how simple it is:
 
12:42 AM
@OlegValter I have made one work.. :) No need to type a lot. I did not use jQuery :D
 
@Scratte ok :)
@KevinM.Mansour I thought scripting was the past, present, and future of SO already?
 
But I do not understand how Promises work, which is OK I think.. since I just used fetch(url)...
 
@Scratte Already :) It just for support and animation for the text;
 
It took me all night to process the reply though.
 
@Scratte note that the only guarantee of a full load is the load event listener registered on window :)
 
12:45 AM
@KevinM.Mansour No :) JavaScript can also make GET and POST requests :)
 
@Scratte No, He mean "Scripting the future of Stack Overflow;" when I replied;
 
@OlegValter Not accounting for pending ajax request, I assume.
 
@KevinM.Mansour the chance of getting suspended for automation on SO is abysmally low :) Just make sure you don't violate common sense (i.e. tracking a user to put a downvote on every post they make [yes, there is a script for that. And it is petty. And, unfortunately, seems like it is still in use])
 
I have to wrap half of my functions into $(document).ajaxStop(function() {...}). Else I just get null elements. I should probably find out how to do that in JavaScript.
 
@Scratte you mean the one you issue or the ones that load everything else?
 
12:48 AM
@OlegValter What?? Is that happen; I am never done that and never will do that;
 
@OlegValter The one that is started by the page itself. This is especially bad in review.
 
@KevinM.Mansour of course that's happened, it is a local rule 34 version: if there is a feature, there is a script for automating it :)
 
@OlegValter :)
 
I think the rule is: If it's OK to do without a script, it's OK to do with a script.
 
@Scratte load should account for that, methinks - it only fires off once everything is done - or are you saying its not working?
@Scratte I doubt everyone is following the rule :)
@KevinM.Mansour it is actually surprisingly easy to accidentally DDoS a service :)
 
12:58 AM
@OlegValter you just gave me a good idea; I will try that on Facebook :)
Is there better solution to remove elements better than .style.display= "none"
 
@KevinM.Mansour <any node>.remove()?
 
document.querySelector(".js-team-nav-link").remove();
 
^ or style.visibility = "hidden"? Each has its own use case, though
 
Is that will work or I might want to remove ()
 
remove and display: none both remove an element from the DOM (either literally by detaching or hiding)
while visibility only toggles if the element is visible (it still takes its place in the DOM)
@KevinM.Mansour hm?
 
1:06 AM
@OlegValter Summery document.querySelector(".js-team-nav-link").remove(); will work?
 
@OlegValter It is not working :) Not on Opera.
@OlegValter I have not been able to make that work :( I go the parent and removeChild()
Oops :)
 
@Scratte That element not getting remove <li class="fs-fine tt-uppercase ml8 mt16 mb4 fc-light">Find a Job</li>
@Scratte Where is .
 
Yes, I noticed :)
 
@Scratte you noticed what?
 
That there is . :)
 
1:13 AM
@Scratte OK
:)
 
It helps you to use the console.. a lot. Put the element into a var myElement.
Then print the element to the console.
Then use myElement.remove()
see what happens..
when everything is working, then remove your debugging.
I have gotten some error from .remove(). But maybe it's just my imagination.
 
@Scratte Otherwise <li class="fs-fine tt-uppercase ml8 mt16 mb4 fc-light">Find a Job</li> not getting removed
 
so I use myElement.parentNode().removeChild(myElement);
 
@Scratte Using document.querySelector(".fs-fine.tt-uppercase.ml8.mt24.mb4.fc-light").style.display = "none";
Worked well `document.querySelector(".js-team-nav-link").remove();`
but getting `undefined `
 
Yes, that is because nothing is returned, no? :)
 
1:21 AM
@Scratte Aw. I thought it will return "none" but yes, because it is function.
 
That is just in the console when you run it directly, right?
 
@Scratte Right.
 
That's fine :)
I think I need to sleep now. It seems I have to construct a userCard from the group up for the editor, and it's making me very tired.. and it's 3:23 in morning too.
 
@KevinM.Mansour you should always guard before calling a method :) querySelector can return null and cause a runtime error if you try to do that - save to variable, check if it is truthy (nodes are objects -> always truthy), then proceed
 
And always listen to Oleg :)
 
1:24 AM
@KevinM.Mansour depends - if the selector is correct + you are waiting for at least the DOMContentLoaded event to fire, should be enough
 
@Scratte It is 3:23 for me. I must sleep. 😴. Have a good dreams with userCard
 
@Scratte don't do that, that's a bad idea :)
 
Not sure if Kevin knows what you mean when you say "truthy". But it means "if (myElement) {...}"
 
@OlegValter No, you great Javascript dev.
@Scratte Right, I was writing in Google.
 
@Scratte hm, so you say the element you are looking for is added after a separate request made by the page?
 
1:26 AM
It means that if myElement is null, then "if (myElement) {..}" will go to false. Else it will always go to true :)
 
@Scratte Thanks.
 
@Scratte why not, I thought "truthiness" is a universal concept?
 
@OlegValter It is. But it also requires some experience with JavaScript to understand how to use it :)
 
@KevinM.Mansour have a good night's sleep! FYI, it is 4:28 AM for me :)
 
@OlegValter I though you wanted to get more daytime. Or did you just get up now and waiting for the sun?
 
1:29 AM
@OlegValter You hit a high score; Good Night.
@Scratte I wait sometimes for Sun.
 
@Scratte yeah, that's true :) especially the "empty strings are falsy", "null is truthy", "empty array is truthy" (a specification of "every object [except null :)] is truthy")
@Scratte you are correct :) Got up an hour ago
 
@Scratte Wish you a good night with userCard
 
@OlegValter Heh.. that's nice. Perhaps I will talk to you later then. Btw: I made the post user cards work. Both the author and last editor. But I've yet to do the suggested editors user card.
 
@Scratte thumbs up :) That's really nice to have (I guess I will concentrate on the other features then and will not duplicate what you already made)
 
@OlegValter What is missing? Apart from the editor userCard?
 
1:36 AM
Did SO markdown just break?
I found a bug with SO markdown
 
I do not think so.. it starts with a <pre> then the triple backticks
 
That is sort of funky
 
@Spectric Yes. I think they added it themselves. Also.. the backticks must be on the beginning of a line.
Considering they are using quotes for "HTML" and "CSS".. I think it's safe to say that they are.. confused :)
Hehe.. :)
 
How can I import css file into Javascript and where to add that css file to call it inside js where in userscript
 
You have deliberately edited your messages before deleting them :D
 
1:42 AM
@Scratte Yes I saw it.
:52139289 Again :)
 
But.. I can still see the history, silly! :)
 
@KevinM.Mansour What do you mean?
 
@Scratte not necessarily something is missing :) I want to add a graph of recent review history (approvals to rejections) to see what a mood I am in this week :)
 
@Scratte What? No way!
 
1:43 AM
@Spectric Again you deleted message
@Scratte Page not found.
@Spectric He is tricky person ;)
 
I can view it for some reason.
@KevinM.Mansour Me? Tricky? No...
 
@Spectric I think it might also be an overt spam
 
@Spectric Yes, it's your message. Room owners and message owners can see them :)
 
@Spectric But for me "Page not found."
 
I think I can see it because I sent it
 
1:45 AM
@Spectric No, I mean @Scratte
 
@KevinM.Mansour Anyways, what problem are you encountering with the userscript?
 
How can I import css file into Javascript and where to add that css file to call it inside js where in userscript
 
Import?
 
@OlegValter Fancy! :)
 
What do you mean by 'import?'
 
1:46 AM
@KevinM.Mansour You do not need to import it into JavaScript. It just needs to be added to the page.
 
@KevinM.Mansour you can't :) You can emulate it with a development environment, but in the end, it will be a separate css file or an inline style. If you want dynamic loading of styles, you can create a <style> element in the script, set src to a remote-hosted stylesheet and append the element to the document - once it loads, the styles will be there
 
@Spectric anyway when I try to remove that element it does not remove; <li class="fs-fine tt-uppercase ml8 mt16 mb4 fc-light">Find a Job</li>
using document.querySelector("li.fs-fine.tt-uppercase.ml8.mt16.mb4.fc-light").remove();
which is in Find a Job in SO Homepage left-menu
 
@KevinM.Mansour you simply can't use CSS in JS apart from CSSOM (CSS object model) API: developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model
 
@KevinM.Mansour Why are you not putting it into a variable? var myElement = document.querySelector("li.fs-fine.tt-uppercase.ml8.mt16.mb4.fc-light"); Then console.log("myElement", myElement);
 
Could you post your code somewhere? I suspect the element hasn't been loaded when you tried selecting it.
And also, if you're trying to remove the 'Find a Job' widget on the left sidebar, I have a userscript that does it for you: stackapps.com/questions/8925/stack-focus-v2-0
 
1:50 AM
@Scratte :) Another thing I thought of is adding info that someone else already approved/rejected the edit once and their stats. Because usually it helps make the decision easier (i.e. when I know that somebody marked the edit as "copied content")
 
@Spectric Wait?!?.. That also removes "Related" and "Linked" :D We need those! :)
@OlegValter You cannot do that anymore. Stack is not giving out that information. If I understand it correctly, they have actively removed it recently (some months ago).
 
@KevinM.Mansour it is not removed and the script doesn't die? I find it impossible - you either get a runtime error (calling remove on null), or the element is removed
 
@Scratte You can choose to remove which ones. That's version 2, not 1 ;). It's on StackApps
 
You only "get" a runtime error if you have the devtools open and you see it :D
@Spectric Ahh.. I see. That is nice :)
 
@Spectric that's neat :)
 
1:55 AM
Thanks :)
 
(function() {
// Wait until page be ready (Document Ready).
document.querySelector(".fs-fine.tt-uppercase.ml8.mt24.mb4.fc-light").remove();
//document.querySelector(".fs-fine.tt-uppercase.ml8.mt24.mb4.fc-light").remove(); // This is element
document.getElementById("your-communities-header").remove();
document.querySelector("#your-communities-section").remove();
document.querySelector(".js-team-nav-link").remove();
document.getElementById("nav-jobs").remove();
document.getElementById("nav-companies").remove();
 
@Scratte I am stubborn :) I know they actively remove useful info from reviewers to make us more like input machines for a neural network instead of humans that can make decisions on their own. That's why I want to have my info back :)
 
@KevinM.Mansour Are you OK with using jQuery?
 
@Spectric yes
 
@Spectric Nobody is OK with that in here ;)
LOL!
 
1:56 AM
@Scratte you don't have devtools constantly open? :)
 
@OlegValter I do when I'm creating a script :)
 
@Spectric if it native it will be great but at all post solution.
 
@OlegValter But there is no way to get it back.. the API will not tell you and loading it as public (not logged in) will not tell you either.
 
@OlegValter agree
 
(function() {
    'use strict';
    $(document).ready(function() {
        document.querySelector(".fs-fine.tt-uppercase.ml8.mt24.mb4.fc-light").remove();
        //document.querySelector(".fs-fine.tt-uppercase.ml8.mt24.mb4.fc-light").remove(); // This is element
        document.getElementById("your-communities-header").remove();
        document.querySelector("#your-communities-section").remove();
        document.querySelector(".js-team-nav-link").remove();
        document.getElementById("nav-jobs").remove();
 
1:58 AM
@OlegValter Hehe I was wondering when someone will notice. I have my exams going on right now so I don't have time to participate normally on SO and in chat. I need to focus on my studies so I am using Meta as a reward after studying for sometime 😅 i.stack.imgur.com/gx5p6.png -- costs me 5 coins ;)
 
@Yatin coins of what?
@Spectric nice but not working :(
 
@Scratte most likely - but I need to try to be sure :)
 
A gamified todo app habitica.com ;)
 
@KevinM.Mansour This is a userscript right? Do you have the comments at the start of the file?
 
@Yatin Wait what?!? Coins?!?
 
2:00 AM
 
@Spectric as a native alternative to jQuery's ready:
 
@KevinM.Mansour add this to the start of your userscript:

// ==UserScript==
// @name Userscript Name!
// @namespace some-weird-stuff.info
// @version 0.1
// @description Description of your userscript
// @author Your name
// @match https://stackoverflow.com*
// @grant none
// ==/UserScript==
 
window.addEventListener("load", () => {
  //all your code goes here, never before
});
 
// ==UserScript==
// @name        General Editing for Stack Overflow Homepage.
// @namespace   Violentmonkey Scripts
// @match       https://*.stackexchange.com/*
// @match       stackoverflow.com
// @grant       none
// @version     1.0
// @author      Kevin M. Mansour
// @description General Editing for Stack Overflow Homepage.
// ==/UserScript==
/*
(function() {
  // Wait until page be ready (Document Ready).
    document.querySelector(".fs-fine.tt-uppercase.ml8.mt24.mb4.fc-light").remove();
@OlegValter test by yourself;
 
2:01 AM
@Yatin "Improve Your Habits by Playing a Game" by spending more time on the internet playing a game? :P
 
I have gotta go. Exam in 2 hours 😬
 
@KevinM.Mansour ?
 
@Scratte Yea yea :p
 
@Yatin good luck!
 
@Scratte I know kinda weird but fun too ;)
 
2:02 AM
@Scratte hehe
 
@OlegValter Thank you :D
 
@Yatin Good Luck; Wish you best;
 
@Yatin Good luck. Come back and tell us how it went :)
 
@OlegValter wrong reply;
@Spectric test by yourself;
 
2:03 AM
Thank you 😀 I have the last one tomorrow :D
 
Fingers crossed :D
 
@OlegValter nice but what?
 
@KevinM.Mansour - the element is clearly in the DOM after the document finishes loading
 
:)
Bye!
 
@Yatin Lets hope isn't not "Make a Facebook webpage in less than 4 hours"
 
2:04 AM
@KevinM.Mansour from what I see in the source code of your userscript:
 
@OlegValter could you share class or I am doing that in worng way
@OlegValter or edit my code above;
@Scratte hehe
 
1. there is no @run-at directive (read: delegate event handling to Tampermonkey)
2. the uncommented code is executed immediately in an IIFE -> does not wait for page load
 
@OlegValter This only works for some browsers. I am not sure how Edge is with that.
 
:52139414 Uncaught TypeError: Cannot read property 'remove' of null
    at HTMLDocument.<anonymous> (General Editing for Stack Overflow Homepage..user.js:28)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at Function.ready (jquery.min.js:2)
    at HTMLDocument.K (jquery.min.js:2)
 
IIFE - Immediately Invoked Function Expression
 
2:06 AM
@Scratte likely :) My only point is that there is no code / directive that waits until the page is loaded :)
@KevinM.Mansour told ya :)
 
@Scratte ok watched course for that yesterday;
 
This is why I use $(document).ajaxStop(function() {...}) :)
 
@OlegValter how to solve it?
adding onpage be ready documant
 
@KevinM.Mansour how familiar you are with how a web document is loaded?
 
:52139428 document.addEventListener("DOMContentLoaded", function(event) {
    // Your code to run since DOM is loaded and ready
});
or
$(document).ready(function() {
    console.log("Ready!");
});
in Jquery;
 
2:10 AM
You cannot use any other thing when you use "fixed font". Not even a reply :)
 
@Scratte Aw, Did not know that,
 
":52139428" is the message id that you replied to ;)
But because you're using "fixed font" which means that everything here is code, it will put it as code :)
 
:52139428
 
You need more than the id.. I think :)
 
@Scratte i think it worked;
 
2:13 AM
Try to type this ":52139451 I am replying to myself" <-- without the "
 
@KevinM.Mansour I am replying to myself
 
:)
 
@Scratte works well I will spam my self;
later;
 
Heh.. that will get boring quickly, no? :)
While Oleg tries to figure out how to hack Stack and get the review information, I will sleep and dream of user cards :D
 
@Scratte yeah
@Scratte Good Night :)
 
2:31 AM
@Scratte do developers dream of user cards? :)
@KevinM.Mansour so, is there a problem? I have no issues with the element being removed or the code being run to completion
 
 
1 hour later…
3:49 AM
phew, at least I figured out how to get the rejection votes :)
^ thankfully, that information can be extracted from the modal
but the prospect of approval votes looks grim
 
@Spectric yes, seen it. I dunno what to think about it, to be honest. The Windows version looks kind of dreadful with the Consolas font, but will see once it goes live
 
4:22 AM
@Scratte argh, can you find an MSO/MSE post about it? I am out of ideas, tried to find it for half an hour, maybe I am too sleepy today
 
 
2 hours later…
6:22 AM
a closed post title on SO just made my day:
user image
4
 
 
2 hours later…
8:19 AM
^ welcome dynamically generated reject votes widget (logic for reject votes count is separate, so feel free to repurpose) JS: pastebin.com/YkG5R39h. TS: pastebin.com/RSpBTwMb
the hardest part was to deal with the freaking modal that for some BS reason is removed from DOM (not hidden!) when it is closed and then appended again (sic!) every time the "reject" option is selected and the "submit" button is clicked. What's more, it is not appended to the page the first time page loads - only after clicking "submit"
 
@OlegValter There is no meta post about it. It was never announced.
 
@Scratte thanks :) I was already so desperate as to barge in to MSE Tavern
 
@OlegValter Huh? So you found something that will tell?
 
@Scratte yes, the rejection dialog has these values prefetched :) The only problem is that it is served as a chunk of CSS + JS + HTML, so is only available after parsing
 
I'm not sure I understand.
 
8:26 AM
^ I am also going to make it "live" a bit later :) By setting the logic to a recursive timeout, the vote values can be fetched live
one caveat: no accept votes for me :( But I think those are not that important
 
Hmm.. so when someone presses "reject" this is part of the result? Before one was actually rejected.. that is very very odd.
 
@Scratte hm?
 
@OlegValter Is this information part of the what is loaded on the page before making a choice resulting in opening of a dialog? Or does it come when one has picked a choice "Reject" but before pressing "Reject" on the dialog?
 
@Scratte it comes with the first load of the review task page :) I think it is updated if a socket reports the new review, but since we only need 2 rejections, I am not inclined to think about it too much :)
 
@OlegValter Ok, so you're not making a call to simulate a reject and then processing the result?
 
8:34 AM
@Scratte hm, why would I need to do that? :) When you select "reject" and then hit "submit" -> the dialog is appended with this info, so I am programmatically doing just that and then simply close the dialog without submitting - 0 risk
 
@OlegValter I thought that every submit would send a request. So that it wouldn't be part of the initial load, but fetched on the fly at the time of the submit.
 
@Scratte I thought so too, but nope :) Only instant actions make the request
 
I see.. so you just dug really deep into the HTML? :)
 
as to what reason, I guess it is the same as the one used to justify lying to users about their post reception - database call savings (and to hell with the UX).
 
I'm wondering if we want this though.. some users will reject for bad reasons.
And it will be biased to make user reject, since it will not show any approvals, right?
 
8:41 AM
and JS :) As soon as found that there is nothing that checks that the reviewer is able to submit before actually submitting (so the action either passes or fails - no safeguard there),
I started looking for where this dialog lived - turned out the page's JS adds/removes it on-demand
 
Lets hope my Buttonsâ„¢ don't go off and make any requests to Stack.. :D
 
@Scratte my philosophy on information is - the more available, the better. The users need education, training, explanations, audits, etc - not hiding information from them. A bad reviewer will reject for the wrong reason regardless :) It is how things are with security - the worst thing one can do is to rely on security-by-obscurity.
@Scratte as far as I understand, only the "approve" button will do that. All others either load a modal (with rejection reasons) or an edit mode ("improve"/"reject and edit")
what I find puzzling is that instead of removing vote info, SE should better remove the isAudit public field available live on any review task
^ all this talk about catching robo-reviewers and then a field that bots can easily tap into :)
I think I noticed that one of your userscripts (probably rene's one for reviews - correct me if I am wrong) does just that by immediately identifying a review audit to you
 
8:58 AM
@OlegValter Yes and no. If it only gives information that will make other be biased towards one result, then I'm not so sure about it.
@OlegValter That is the only interesting one :D I use it :)
@OlegValter That is my user script. It will change the text of the "Skip" button. I got the idea from Samuel's user script and borrowed some code.
I'll still need to read your code and figure out what you're going :)
Also.. I know you're putting the info in a box under the radio-button box. I'll try to figure out where to put this :) I have removed that box.. :)
 
9:14 AM
@Scratte I see :)
@Scratte yeah, the update was significant - damn the server-side rendering, I wish SE just sent a config object along for every page component
@Scratte the logic that parses the info is independent of the one that creates the box, so feel free to bind to any presentation component you want :)
 
I've done it this way: I started making my own script because I wanted to make buttons and remove the radio-button box. So I wasn't interested in another box. So when you've done something in yours that I want in my, I just take those bits :D
I did however run into a wall yesterday with the editor user card. There's nowhere I can take that from. I am "scraping" the original post for the other user cards. Then using the result and making that into a DOMdocument and then picking the nodes from that
 
@Scratte that one I will have to disagree with: biasing is not good or bad by itself. Providing a clear indication that the edit already has a "spam" vote (or others) is what biases the reviewer against the "approve" action, so I think it is a win. Also, an accidentally rejected edit does less harm than an approved one. If at the same time we train the reviewers to better understand the edits, then we are all good
@Scratte I just find it ironic that the only info that's detrimental for correctly checking that the reviewer is paying attention is the only one they still send :)
 
@OlegValter Heh.. but that doesn't mess with the "make up your own mind on the review". I think that is why they removed the information. They don't want users to be biased towards what other users picked.
 
@Scratte yup, that's why I try to keep things as modular as possible :)
 
@OlegValter Yes, I can and I am using your code in copy'n'paste :)
 
9:23 AM
but the script itself is growing quite large, so I intend on adding a build step - too much clutter in one place
 
I have put everything into separate functions. Then I'm calling the functions at the end. So one can remove whatever one doesn't want.
@OlegValter I think some rejections are bad. The "this is too minimal" makes sense sometimes, but I think it's overly used.
I also think some reviewers will reject any edit to code, even if it's a good edit. I have seen that quite a few times and it bothers me.
This is why I'm not entirely convinced that I want to put this in.
No one will ever see "Someone else approved this". They'll only ever see "Someone else rejected it". The review could easily have one reject and one approve, but this script will only show the one reject.
Though I am very impressed that you managed to figure out how to find this information :)
 
@Scratte my approach as well :) I will connect it to config once I have a decent list of features
 
I have not used your config very much :(
I have magic numbers everywhere :(
I will slap myself later.. I promise! :P
 
@Scratte I agree, however, one wrong approved suggestion does more harm than one rejected valid as it is forever written into the database :) And the post is then removed from the queue - so unless someone chances on the post, it will sit there forever
@Scratte I meant user prefernces, sorry for confusing you :)
^ as for the config proper, I always keep a config object for my projects because it allows for easy modification of constants :)
 
@OlegValter That depends on your perspective. It's one wrong edit, sure.. But one wrong reject can make a user never ever edit anything ever again.
Which is the case with me. I absolutely refuse to edit any post.. I have removed all the edit links with a user script, that keeps the link on my own posts only. And this is a result of a "Rejected edit" on an edit that was actually good.
 
9:34 AM
@Scratte I can say the same for good reviewers that just stop when they see the BS that gets approved :)
@Scratte that one's tricky, yes - I tend to approach it case-by-case
@Scratte this is what I, on the other hand, consider the good thing - "normal" course of events should not stick out (the "good" edit - it is assumed the edit is good unless it is bad)
 
If I add this, I will perhaps add it as something that needs to be clicked, with a warning on it that says that "Other user's approvals can not be fetched, so only other rejects can be show here. Use you own judgement" or something similar.
@OlegValter Yes, but someone reviewing is likely to pick whatever someone else picked, just because they know someone else picked it, is what I'm saying :)
 
^ a simple analogy (which, given the nature of an argument by analogy, may fall flat on its face, so I apologize in advance) is traffic light regulation:
you don't get "good citizen" points for crossing the street correctly (unless you are in an anti-utopia or ... China :)), but you get fined (or reprimanded, or whatever) for doing so incorrectly. Same with suggestions
 
That is a separate thing. The analogy isn't fair :)
 
@Scratte I am still determined to continue and try to find (or campaign for) the other half of the info :)
^ although I am not trying to convince you to use it, just explaining my reasoning
 
Because no one gets hurt by someone not crossing the road for a green light. You can have a reviewer walker that just stands still no matter if the light is green or red. And no one will get hurt by it :) That is not the same as rejecting a good edit. Someone does get hurt by it.
@OlegValter I would be much more open to including it if you can get the other part of the info :)
 
9:41 AM
@Scratte exactly, that's why I mentioned that not all bias is bad :)
@Scratte regarding "no one gets hurt"- well, statistics on traffic accidents usually says otherwise :)
 
@OlegValter lol! Because cars do suddenly go on sidewalks?
 
@Scratte anyways, I will try, but the perspective looks grim...
 
@OlegValter Yes, I think you just found a small loophole that will let you in on one secret. But not all the secrets.
 
I even considered using SEDE, but having an accuracy of "went stale from 1 to 7 days ago" wasn't looking particularly schick :)
 
@OlegValter Yes, SEDE isn't useful for real time information :)
I use it once a week to see how far away I am from an "Unsung Hero" :)
 
9:45 AM
@Scratte although it is a good option for tag wiki suggestions :) They have a half-life of just about a month
 
I have a question for you. A technical one. I have used this setup to get user cards:
            fetch(postlink)
                .then(response => {
                    if (!response.ok) {
                        throw new Error('Network response was not ok');
                    }
                    return response.text();
                 })
                .then(data => {
                     // developer.mozilla.org/en-US/docs/Web/API/DOMParser
                     var userCards = new DOMParser().parseFromString(data, "text/html")
                                                    .querySelector(thePost)
This is not a full MCVE :D
I am returning the text() part of the response and then parsing it with a DOMParser() to be able to get the nodes that I'm interested in. But since I'm a crappy JavaScript developer, I'm very unsure if this is a good way to do it.
 
@Scratte no, because pedestrians get hit often when they cross on red light :) [citation pending]
@Scratte a sec
@Scratte LGTM
 
@OlegValter Ahh.. but that was not the analogy that I imagined in my head. I'm not referring to how many points one gets for stopping at the red light. Because obviously no one gets points for that. I am referring to not walking on a green light :) See, the rule is you must stop for a red, but there is no rule saying you must walk on a green :D
 
two minor feedback points:
1. As I am sure you noticed, forEach's could've been merged into one
 
@OlegValter That is just for debugging purposes. I just wanted to print the user cards, so I could get the HTML :)
The userCards.forEach(node => console.log("postUserNode",node)); will be removed :)
 
9:54 AM
2. Ditch the forEach :) userCardDiv.append(...[...userCards])
^ or even better, do the [...] part when assigning to the userCards variable
 
That looks so... hacky :D
 
@Scratte no, just the modern way to do things :) Spread operator
In this case, it is basically the same as Array.from(<array goes here>)
 
@OlegValter Hmm.. so .querySelectorAll(".post-signature.grid--cell"); becomes .[...querySelectorAll(".post-signature.grid--cell")]; ?
 
3. Bonus: merge thePost and .post-signature.grid--cell selectors :) Just querySelectorAll immediately with ${thePost} .post-signature.grid--cell
 
No $.. :)
 
9:59 AM
@Scratte yup :) TS in strict mode with a target lower than ES6 will complain, though (because ... implies an iterator)
 

« first day (349 days earlier)      last day (1075 days later) »