{
    "version": "https://jsonfeed.org/version/1",
    "title": "eay.cc",
    "description": "Weblog von Stefan Grund",
    "home_page_url": "https://eay.cc",
    "feed_url": "https://eay.cc/2018/bookmarklet-to-get-the-number-of-your-gitlab-contributions-in-2018/feed/json",
    "icon": "https://eay.cc/apple-touch-icon.png",
    "favicon": "https://eay.cc/favicon.ico",
    "author": {
        "name": "Stefan Grund",
        "url": "https://stefangrund.de/",
        "avatar": "https://stefangrund.de/avatar.jpg"
    },
    "items": [
        {
            "id": "35151",
            "_type": "standard",
            "url": "https://eay.cc/2018/bookmarklet-to-get-the-number-of-your-gitlab-contributions-in-2018/",
            "title": "Bookmarklet to get the number of your GitLab contributions in 2018",
            "content_html": "\n<p>If you are working with <a href=\"https://gitlab.com/\">GitLab</a> and are interested in the number of contributions you&#8217;ve made this year, here&#8217;s a handy, little bookmarklet to calculate your contributions.</p>\n<p>\u2192 <a href=\"javascript:%28function%28%29%7Bvar%20rects%3Ddocument.querySelectorAll%28%27%23activity%20.js-contrib-calendar%20rect.user-contrib-cell%27%29%3Bvar%20name%3Ddocument.querySelectorAll%28%27.user-info%20.cover-title%27%29%5B0%5D.textContent.replace%28/%28%5Cr%5Cn%5Ct%7C%5Cn%7C%5Cr%5Ct%29/gm%2C%27%27%29%3Bvar%20yearToCount%3D%272018%27%3Bvar%20counter%3D0%3Brects.forEach%28%28item%29%3D%3E%7Bvar%20text%3Ditem.getAttribute%28%27data-original-title%27%29%3Bvar%20count%3Dtext.substr%280%2Ctext.indexOf%28%27%20%27%29%29%3Bif%28text.indexOf%28yearToCount%29%3E-1%26%26count%21%3D%3D%27No%27%29%7Bcounter+%3DparseInt%28count%29%7D%7D%29%3Balert%28name+%27%20did%20%27+counter+%27%20contributions%20in%20%27+yearToCount+%27.%27%29%7D%28%29%29\"><strong>GitLab Contributions Bookmarklet</strong></a></p>\n<ul style=\"list-style: decimal;\">\n<li>Drag the link above to your browser\u2019s bookmark bar.</li>\n<li>Go to <code>https://gitlab.com/users/&#8203;[username]/activity</code><br />(replace <code>[username]</code> with, well, your username and, if necessary, <code>gitlab.com</code> with your custom domain).</li>\n<li>Hit the bookmarklet and \u2013 voil\u00e0 \u2013 there&#8217;s the number of your contributions made in 2018! \ud83c\udf89</li>\n</ul>\n<p><img decoding=\"async\" src=\"https://eay.cc/uploads/2018/gitlab-contributions.png\" alt=\"Screenshot of GitLab contributions bookmarklet\" /></p>\n<p>Here&#8217;s the JavaScript, if you&#8217;re interested or want to run it in your console:</p>\n<pre><code class=\"language-js\">(function() {\r\n\tvar rects = document.querySelectorAll('#activity .js-contrib-calendar rect.user-contrib-cell');\r\n\tvar name = document.querySelectorAll('.user-info .cover-title')[0].textContent.replace(/(\\r\\n\\t|\\n|\\r\\t)/gm,'');\r\n\tvar yearToCount = '2018';\r\n\tvar counter = 0;\r\n\trects.forEach((item) => {\r\n\t\tvar text = item.getAttribute('data-original-title');\r\n\t\tvar count = text.substr(0, text.indexOf(' ')); \r\n\r\n\t\tif (text.indexOf(yearToCount) > -1 && count !== 'No') {\r\n\t\t\tcounter += parseInt(count);\r\n\t\t}\r\n\t});\r\n\talert(name + ' did ' + counter + ' contributions in ' + yearToCount + '.');\r\n}())</code></pre>\n<img decoding=\"async\" src=\"https://eay.cc/wordpress/count.php?url=https%3A%2F%2Feay.cc%2F2018%2Fbookmarklet-to-get-the-number-of-your-gitlab-contributions-in-2018%2F\" style=\"border:0;\" width=\"1\" height=\"1\" alt=\"\" />",
            "date_published": "2018-12-28T10:39:35+00:00",
            "date_modified": "2019-01-10T12:57:12+00:00",
            "author": {
                "name": "Stefan"
            },
            "tags": [
                "2018",
                "bookmarklet",
                "git",
                "gitlab",
                "javascript",
                "quantified self",
                "web-entwicklung"
            ],
            "_short_url": "https://eay.li/38a",
            "_syndication": [
                "https://twitter.com/eay/status/1078620528389304320",
                "https://twitter.com/eay/status/1078620657175445509",
                "https://eay.social/@eay/101318541488015607"
            ]
        }
    ]
}