Max140

On twitter dot com, truncate tweets of > 140 characters

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

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

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

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

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

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Max140
// @version      0.2
// @description  On twitter dot com, truncate tweets of > 140 characters
// @author       Kevin Shay
// @match        http://tampermonkey.net/index.php?version=4.4&ext=dhdg&updated=true
// @grant        none
// @require https://code.jquery.com/jquery-2.1.4.min.js
// @include      https://twitter.com/*
// @namespace https://greasyfork.org/users/154233
// ==/UserScript==

(function() {
    'use strict';

    window.setTimeout(function () {
        $('.js-tweet-text').each(function () {
            var tweet = $(this).clone();
            // Emoji
            tweet.find('img').replaceWith('X');
            // External links don't count but hashtags do
            tweet.find('a').not('.twitter-hashtag').remove();
            var text = tweet.text();
            if (text.length > 140) {
                var extra = ' <span style="color:red;font-weight:bold;">+' + (text.length - 140) + '</span>';
                $(this).replaceWith($(this).text().substring(0, 140) + extra);
            }
        });
    }, 2000);
})();