drupal.org — Number of total projects

Show number of projects on the drupal.org user profile.

  1. // ==UserScript==
  2. // @name drupal.org — Number of total projects
  3. // @description Show number of projects on the drupal.org user profile.
  4. // @author Rafal Enden
  5. // @namespace https://github.com/rafenden
  6. // @homepageURL https://github.com/rafenden/userscripts/blob/master/drupal-profile-projects-counter
  7. // @supportURL https://github.com/rafenden/userscripts/issues
  8. // @license MIT
  9. // @version 1.0
  10. // @match *://www.drupal.org/u/*
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. 'use strict'
  15.  
  16. const projectsElement = document.querySelector('.versioncontrol-project-user-commits')
  17. const totalProjects = projectsElement.querySelectorAll('li').length
  18. projectsElement.insertAdjacentHTML('beforebegin', `<p>Total projects: ${totalProjects}</p>`)