thomas-ashcraft / alienware_arena_helper

Helps you to easily earn daily ARP and improves site with usable features
GNU General Public License v2.0
53 stars 9 forks source link

Verifying post date doesn't work anymore #24

Closed Lucki closed 4 years ago

Lucki commented 4 years ago

Following post time search doesn't work anymore: https://github.com/thomas-ashcraft/alienware_arena_helper/blob/b4fe86e41b54676f1c108f93a5a7704e02c09688/alienwarearena_helper.user.js#L880

The relevant part is missing and probably hidden inside some obscure javascript:

<span class="timeago"></span>
thomas-ashcraft commented 4 years ago

Just looked into this. Don't know what they thinking. It almost looked like they've finally started to trying to not duplicate data, sent over net.

All the timestamps for that particular <span> you targeting is now taken from <article> by updatePostTimes() function. But thats function affects only comments, not first message of topic. Looks like the first message is considered a content. Like in other sections: news, videos, images, etc... Anyway.

Timestamp for the first message is inside anonymous JS function, inside yet another <script> tag. Just like that:

$('.common__op-meta .profile-username .timeago').attr('title', '2019-11-02 04:06:58Z').timeago();

RegEx like this one should do the job

/\$\('\.common__op-meta .*?\.timeago'\)\.attr\('title', '(.*?)'\)\.timeago\(\);/
thomas-ashcraft commented 4 years ago

Closed in https://github.com/thomas-ashcraft/alienware_arena_helper/commit/e4f5b926745a1907b706dec64ba361a733f282a3

thomas-ashcraft commented 4 years ago

Why the hell only after a commit I remembered that status object (the one we getting from API) have current quest's start and end timestamps? Means I shouldn't made those date calculations.