GOG.com - Updated Thread Count in Title

Display a count of updated threads in the GOG forum list page title and icon and reload once an hour so a pinned tab can be used as an update notifier

اعتبارا من 07-09-2014. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name        GOG.com - Updated Thread Count in Title
// @namespace   ssokolow.com
// @description Display a count of updated threads in the GOG forum list page title and icon and reload once an hour so a pinned tab can be used as an update notifier
// @contributionURL http://tinyurl.com/kfgayrh
// @match     *://www.gog.com/forum
// @require   http://cdnjs.cloudflare.com/ajax/libs/tinycon/0.5/tinycon.min.js

// @version     4
// @grant       none
// ==/UserScript==

var category = $(".topics .text:contains('My favourite topics')").parents('h2').next('.category');

var faves_count = category.find('.item:not(.message)').length;
var unviewed_count = category.find('.item:not(.visited) .name a').length;

var bubble_bg = '#9CC824';

if (faves_count == 0) {
    var bubble_bg = '#ff0000';
    unviewed_count = 'X';
}

Tinycon.setOptions({
    width: 7,
    height: 9,
    font: '10px arial',
    colour: '#ffffff',
    background: bubble_bg,
    fallback: false
});
Tinycon.setBubble(unviewed_count);
$('title').text($('title').text() + ' (' + unviewed_count + ')');

setTimeout(function() { window.location.reload(true); }, 3600 * 1000);