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

المؤلف
darkred
التثبيت اليومي
0
إجمالي التثبيت
55
التقييمات
0 0 0
الإصدار
2.0
تم إنشاؤه
27-02-2020
تم تحديثه
14-05-2022
الترخيص
MIT
ينطبق على

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.
    • It fixes the displayed fb comment count (e.g. 6 Comments, instead of "0 Comments" that the site wrongly displays for all such 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.

If you have any bugs, bug fixes or ideas, please report at my GitHub repo