The time/date on the left of the articles listed on the main page are now displayed in the local timezone of the user and in real time (Kinja returns a cached value that is not updated in real time for relative values, sometimes returning the same “xMIN” (ago) value for 5 minutes, “Hour Rule” posters know what i mean).
- Install the “Tampermonkey” extension (available for most browsers)
- On the settings of the module, click on the “+” to add a new script
- Copy/paste the code, from here
- “File => Save”
- Reload the Oppo mainpage
In the Tampermonkey panel, go on the page to edit the script then on the “Parameters” tab where you can put the URL of the script in the “Update URL” field, check the box “Check for updates” then click on “Save”.
It will either check every once a week for update (can be modified on the Tampermonkey settings) or if you “manually” click on “Check for userscripts updates”, no need to copy/paste manually anymore or check this post if there is a new version.
It is possible to use it on Android using the Kiwi browser which is an open-source browser based on Chromium (the open-source version of Chrome), i tried it, it works as on a desktop (the Tampermonkey user interface is not practical on the mobile though).
- The local cache of the data from the posts kept at least 1 minute so it’s fetching the reply count at most once per minute (per post).
- Sometimes it’s not able to get the comments date/time infos (and thus, keeping the non modified version), usually a reload of the page fixes it ; i am trying to figure out how to fix it.
The time/date on the left of the articles listed on the main page are now displayed in the local timezone of the user and relative values are calculated in real time (Kinja returns a cached value that is not updated in real time for relative values, sometimes returning the same “xMIN” (ago) value for 5 minutes, “Hour Rule” posters know what i mean).
The “and 1 more” poster name bug got un-fixed on 1.5 when i did comment some of the code that was not useful anymore. It is now fixed “again”.
The authors are now back on the main page (Kinja fixed it) so i disabled the function, the script is still removing the newsletter things, correcting the “and 1 more” bug and the posts/comments on the local timezone.
It is now fixing the embiggened posts author that are shown as “and 1 more” (it seems to be happening when the author name is too long).
On non embiggened posts, the poster avatar is now clickable with a link to the author account and the “
| “ is no longer part of the link to the article replies.
It is now removing the “Subscribe to the newsletter” modal (“popup” that show on top of everything else) and the newsletter <div> that is embedded in long articles, usually splitting content in the middle ; it is merging the content before and after it when they are of the same class and type (<blockquote> or <ul> of example), excluding <p> tags as they are already splitting two different lines.
It is now fetching the avatars ID along with the post count and usernames (visiting at least one post of the user is no longer required to have his avatar displayed) if
getDatasFromPosts is enabled (the default).
Also, the script is now applied to other blogs (*.kinja.com/*).
It is now retrieving the posts authors avatar image unique ID (which is part of the avatars URL) and putting it into a cache, enabling the display of avatars of users you visited at least a post once in the last 2 months.
Very small fix : The post date was not corrected when less than a day ago (when in format “Today at *”).
It is now correcting the post/article date (at the top of posts) in a similar fashion as the comments/replies (while keeping the original value if relative (“X minutes/hours ago”)) and i also added to both a relative “Today/Yesterday/Weekday at HH:mm” (weekday if it’s older than yesterday and less than a week old).
Well, i did publish the 0.8.3 and immediately realized something was wrong as previous comments on this page (that i updated from the other day) were all displayed as “X seconds ago” then “X minutes ago” ; the problem was that i did use the “lastUpdateTimeMillis” value of the comments data which seems not to be the last time the comment has been updated but the post it’s linked to has been updated, my bad :(
It is now based on the “publishTimeMillis” value and seems to be working fine, sorry about this little hickup.
This time, there are general improvements on the code and the main addition is the correction of the date/time on the posts replies that are always shown in the New-York timezone which is quite annoying if it’s not yours (should display in local(e) timezone and date/time format) ; it also displays “X seconds ago” if the reply is less than 90 seconds old and “X minutes ago” if it’s less than an hour old.
This new time/date correction fetch the data from the Kinja API that is already loaded when loading the comments and at the moment it does not always work the first time the page is loaded but at worst it should just keep displaying the original time/date of the reply.
To enable/disable this function, you must set
var getRepliesTimestamp = X; where X is 0 (disabled) or 1 (enabled).
Also, since 0.7.1 i did set the auto-update URL on the code so you might want to check or uncheck it if you don’t want the script to be auto-updated if a new version if available (not sure it gets enabled automatically for those updating the code).
So, i made a new update to Oppositelockator that adds the reply count and the link to the poster account on the poster name while using a cache to avoid too frequent queries.
These new features are GETting the post pages as those information are not available on the main page which is not optimal if you have a slow connection and/or a very slow computer, you can disable this retrieval of the post pages by setting
var getDatasFromPosts = 0; at the beginning of the script (instead of
= 1) so it will only work with the infos available on the code of the main page.