Greasy Fork is available in English.

Blabbermouth - generate timestamps and add link to the fb comments area

Generates missing timestamps or converts the existing ones in relative format, and adds link to the fb comments area

Autor
darkred
Denně instalací
0
Celkem instalací
35
Hodnocení
0 0 0
Verze
1.2
Vytvořeno
27. 02. 2020
Aktualizováno
24. 01. 2021
Licence
MIT
Spustit na

This script applies to blabbermouth.net.

Blabbermouth only displays timestamps (just the date) in news listings and pages.
It doesn't display timestamps in cd/dvd reviews pages at all.
The script generates timestamps in relative format, in all cases.

In details:

  • in news and cd/dvd reviews pages:

    • It generates timestamps (making use of the existing published_time data from inside the pages, e.g. 2020-02-20T19:10:22.000Z) in relative format. Also, it recalculates them every 1 minute.
      (the initial retrieved timestamps -converted to local timezone's offset- are tooltips: just hover mouse on a relative date to view)
    • It also creates an (additional) link to the Facebook comments next to the generated timestamp,
      with the comment count from that fb iframe 1 (i.e. 6 Comments, not just "Comments" ).
  • in news listings:

    • As you scroll down each page, it retrieves the relevant target news page in the background in order to get the relevant published_time data from the page, and then generates timestamps in relative format (like above).
      Note: recently (Nov 2020) blabbermouth started offering infinite scrolling in its home page and in news. Since v1.2 now the script also works in paginated news pages.

 

1 Compatibility notes regarding that feature:

  • Violentmonkey: the script works in ok with VM in its default settings.
  • Tampermonkey: in order to work with TM, you have to remove the *://www.facebook.com/plugins/* pattern from TM blacklist (it's blacklisted in TM settings by default).
  • Greasemonkey: not supported.

Credits to Brock Adams for his answer to the StackOverflow question: How can two instances of a userscript communicate between frames?


The script uses moment.js.

Hosted at GitHub