last day (104 days later) » 
09:00 - 16:0016:00 - 23:00

16:05
[ SmokeDetector ] Potentially bad keyword in body (): Glue PySpark job failing with resource issues ✏️ by user1477459 on stackoverflow.com
[ SmokeDetector ] Offensive answer detected, potentially bad keyword in answer (): is Cryomancy scientifically possible? by user76424 on worldbuilding.SE
user435118
!!/stappit
@Daniil what do you need this SD instance for?
user435118
For the 4th or 5th time?
@Daniil and likewise the 4th or 5th of telling you you don't need it...
user435118
I want it
16:12
If all you're trying to do is check whether something is already blacklisted, you don't need a Smokey instance
If you want it because reasons, that's different
user435118
Not necessarily because of my userscript
user435118
Getting experience with GH, more Python stuff, API stuff
user435118
I just started my uscerscript btw and have no idea what I'm doing
@Daniil make an AJAX request for each blacklist file, throw them in localstorage, split into lines, compile each line as regex, write a function that takes a "testString" parameter and tests that string against every regex
user435118
Wait a sec, I'm doing chat right now
user435118
16:15
Posting in chat from my us
I used to know how to do that... not hard, IIRC, it should be one ajax request
I think
yeah, POST https://chat.stackexchange.com/chats/109232/messages/new with fkey and text parameters
where 109232 is the room ID you want to post in
what's fkey though in that, just curious
user435118
Nope
user435118
Doesn't seem to work ...
user435118
16:20
(function() {
    'use strict';

    function fkey(e){
        return e||(e={}),e.fkey||(e.fkey=$("input[name='fkey']").attr("value")),e
    }

    var key = fkey().fkey
    console.log(key);

    const body = await request({
        method: 'POST',
        uri: `${chat.stackexchange.com}/chats/${109232}/messages/new`,
        form: {
            text: "Hello",
            fkey: key
        },
    });
})();
I mean
yeah
${109232} ain't going to work :P
@ThomasWard your chat fkey, run fkey().fkey in a console
user435118
Huh, still not working
user435118
(function() {
    'use strict';

    function fkey(e){
        return e||(e={}),e.fkey||(e.fkey=$("input[name='fkey']").attr("value")),e
    }

    var key = fkey().fkey
    console.log(key);

    const body = await request({
        method: 'POST',
        uri: `chat.stackexchange.com/chats/109232/messages/new`,
        form: {
            text: "Hello",
            fkey: key
        },
    });
})();
user435118
@ArtOfCode ideas? ^
missing a protocol
also where's request coming from?
user435118
const body = await request({
    method: 'POST',
    uri: `${this.chatURL}/chats/${roomNum}/messages/new`,
    jar: this.cookieJar,
    form: {
        text: "Hello",
        fkey: this.fkey
    },
});
what's the source of the function, though
where is it defined?
user435118
Um... inside itself?
wat
Have you defined the request function, or have you loaded a script that defines the request function for you?
user435118
I have no clue :/
16:27
then it's probably not defined
what happens if you type request into a console when your userscript is loaded
user435118
function ()
seems odd
but anyway... add a protocol to the link and see if that works
if not, we'll swap request out for fetch
user435118
Meh, probably userscript conflicts, I have 6 running here
user435118
@ArtOfCode You'll want some credit for the userscript, right? Also would it be an 'official' userscript
user435118
@ArtOfCode Um... what?
16:31
add a protocol
https://
user435118
Oh yh
I don't need crediting, I'm not authoring this :P
user435118
?
user435118
So it wouldn't appear on this list?
test
const message = async (roomId, text) => {
    const params = new FormData();
    params.append('text', text);
    params.append('fkey', fkey().fkey);

    const resp = await fetch(`chat.stackexchange.com/chats${roomId}/messages/new`, {
        method: 'POST',
        body: params
    });
    return resp;
}
16:33
hmmmm curl doesn't like this
@Daniil that... I... wasn't responding to that
kinda need to see the result before figuring whether it goes there or not
user435118
Ok
but there's no fundamental reason why not
user435118
Huh, still not working
const message = async (roomId, text) => {
    const params = new FormData();
    params.append('text', text);
    params.append('fkey', fkey().fkey);

    const resp = await fetch(`chat.stackexchange.com/chats${roomId}/messages/new`, {
        method: 'POST',
        body: params
    });
    return resp;
}

message(109232, 'test');
^ drop all of that in a console
user435118
16:35
test
there we go
user435118
Thanks :D
user435118
test
user435118
test
16:36
@ArtOfCode python and curl don't like this heh
@ThomasWard you probably need cookies
probably
dumps cookies
user435118
Right, next step is to find out how to append to FIRE
user435118
cc @Makyen
user435118
How to extract emails/phone numbers/websites from a MS post? Just a general regex?
user435118
16:43
test
@Daniil yup
user435118
test
user435118
@Daniil Oh shush
@ArtOfCode hmm it doesn't like it with my cookies dumped either says i need to login o.O
interesting
meh not important
goes to do other things
user435118
Why doesn't this log anything?
user435118
16:50
console.log(/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im.test('+1 292 293 393'));
are you actually watching your console page in a debugger to see what log data goes down from the script?
user435118
yep, just realised it's invalid for some reason
user435118
How can I get the ID of a reason?
user435118
17:05
Nvm, found it: 85
user435118
@ArtOfCode Why don't these two match?
user435118
1-844-794-2729
user435118
/^[+]?(1\-|1\s|1|\d{3}\-|\d{3}\s|)?(((\d{3}))|\d{3})(\-|\s)?(\d{3})(\-|\s)?(\d{4})$/g
user435118
AFAIK it's supposed to
which says it does match
17:21
@ArtOfCode that's node.js, using request
user435118
Huh, running it in my userscript says it doesn’t
user435118
    var re = new RegExp("/^[+]?(1\-|1\s|1|\d{3}\-|\d{3}\s|)?((\(\d{3}\))|\d{3})(\-|\s)?(\d{3})(\-|\s)?(\d{4})$/g")
    var term='1-844-794-2729'

    if (re.test(term)) {
        console.log("Valid");
    } else {
        console.log("Invalid")
user435118
It's Invalid
@Daniil new RegExp(/^[+]?(1\-|1\s|1|\d{3}\-|\d{3}\s|)?(((\d{3}))|\d{3})(\-|\s)?(\d{3})(\-|\s)?(\d{4})$/, 'g').test('1-844-794-2729'); should show true in the console, does it?
user435118
@double-beep What's wrong with my code above?
17:24
your placement of the g
oh the quotes
@Daniil regex should not be a string
user435118
Ah it matches now, thanks
ye remove the string parts
this ain't python xD
user435118
I'm done wrt userscripts today
user435118
At least I got a phone number regex :)
user435118
17:27
@double-beep Do you think that regex is fine? i.e. will it match most (95%+ pn's)?
user435118
i'll run some tests for posts with the phone number reason tomorrow
you'll have to go to regex101 and test with a list of valid phone numbers
@Daniil hell no :P
phone numbers are hard to match
it won't match any UK number in its current form
and probably not most other countries too
user435118
17:41
So what regex will match all of them?
user435118
@ArtOfCode ^
there is no single regex
user435118
@ArtOfCode So how do you do it then? Multiple?
@Daniil you can, or you could just... not
I'd just not bother trying to get phone numbers
you'll have plenty with just emails and domains
user435118
17:59
Ok, I’ll start of with emails and domains
user435118
22:05
@Makyen
user435118
> Right, next step is to find out how to append to FIRE
cc @Makyen
user435118
Is there one simple append function?
@Daniil There are many. It depends on what you are doing.
user435118
22:21
@Makyen Didn’t I say already? Append to the bottom if the FIRE tab...
@Daniil But what are you appending? Are you appending just text, HTML text (text containing text representations of both HTML elements and text), elements? Are you using jQuery (probably), or straight JavaScript? What formatting are you doing on the text? etc. etc.
user435118
22:47
@Makyen Just text, jQuery and some bold formatting (but the bold isn’t necessary)
09:00 - 16:0016:00 - 23:00

  last day (104 days later) »