Closed YodaLightsabr closed 3 years ago
@trumank Please read. Thanks!
https://bundlephobia.com/result?p=cheerio@1.0.0-rc.5 Adding cheerio as a dependency? Are you sure you can't just use a RegExp?
The email is also accessible without a separate http request, see https://github.com/edqx/node-scratch-client/blob/c1bb6e8c7086e40abbb7789a7a47a2ec5fe65fcb/src/Struct/AuthorizedUser.js#L14 https://github.com/edqx/node-scratch-client/blob/c1bb6e8c7086e40abbb7789a7a47a2ec5fe65fcb/src/Struct/SessionFlags.js#L29 When you fetch the current user session. See https://github.com/edqx/node-scratch-client/blob/c1bb6e8c7086e40abbb7789a7a47a2ec5fe65fcb/src/Client.js#L66
https://bundlephobia.com/result?p=cheerio@1.0.0-rc.5 Adding cheerio as a dependency? Are you sure you can't just use a RegExp?
@edqx That would be a better way of doing it. If you're so good at RegExp, why not show me how you would?
The email is also accessible without a separate http request, see https://github.com/edqx/node-scratch-client/blob/c1bb6e8c7086e40abbb7789a7a47a2ec5fe65fcb/src/Struct/AuthorizedUser.js#L14 https://github.com/edqx/node-scratch-client/blob/c1bb6e8c7086e40abbb7789a7a47a2ec5fe65fcb/src/Struct/SessionFlags.js#L29 When you fetch the current user session. See https://github.com/edqx/node-scratch-client/blob/c1bb6e8c7086e40abbb7789a7a47a2ec5fe65fcb/src/Client.js#L66
Well this package does not use classes for representing data, and I hadn't seen that. Look, if you're going to get upset because I was trying to contribute and you can do so much better, than go ahead.
Excuse me? Pull requests have to be critiqued, that's the entire point of someone to review them before they get merged.
Look, I'm just suggesting better ways of doing what you want to do.
If you don't want anyone to be critical of your methods or your code then I'm not sure computer science is a good career path.
Cheerio is a 300kb dependency, for a package that should really have as little dependencies as possible, I don't think this is a good method.
It might be worth learning regex if you need to do simple finding in a div, especially if the data is quite predictable like it is in this situation.
Please don't get angry at me for suggesting a better method.
adds a
UserSession.getEmail()
method