NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Facer Sync Count
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Count Facer watch face syncs and reviews
// @author Mircea Marin
// @license MIT
// @match https://www.facer.io/creator
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
(function () {
'use strict';
function getSyncs($param, $hText) {
$('button.btn.btn-primary[ng-click*="' + $param + '"]').trigger("click");
var $header = $('h3:contains("' + $hText + '")');
var $headerText = $header.text();
var $syncElements = $('div[ng-if*="' + $param + '"]').find('div[title="Sync Count"]').find('span.stat-icon-count');
var $reviewElements = $('div[ng-if*="' + $param + '"]').find('div[title="Review Count"]').find('span.stat-icon-count');
var $syncCount = 0;
var $reviewCount = 0;
$syncElements.each(function () {
$syncCount = $syncCount + parseInt($(this).text());
});
$reviewElements.each(function () {
$reviewCount = $reviewCount + parseInt($(this).text());
});
$headerText = $headerText + " - Syncs: " + $syncCount + " / Reviews: " + $reviewCount;
$header.text($headerText);
}
$(document).ready(setTimeout(function () {
getSyncs('draft', 'My Drafts');
getSyncs('published', 'Published Designs');
}, 5000));
})();