Skip to content
This repository has been archived by the owner on Jun 8, 2018. It is now read-only.

BuiltWith serves detailed library usage statistics #144

Open
Anton-Latukha opened this issue Feb 3, 2017 · 3 comments
Open

BuiltWith serves detailed library usage statistics #144

Anton-Latukha opened this issue Feb 3, 2017 · 3 comments

Comments

@Anton-Latukha
Copy link

Anton-Latukha commented Feb 3, 2017

About:
"To keep this add-on from turning into bloatware, it's important to find out which versions of which libraries are most commonly used on websites, so that less popular resources can be removed from the default bundle."

I found https://builtwith.com as most informative platform.
It has overall sites statistics and library-oriented also.
Check-out https://trends.builtwith.com/javascript/jQuery, they have version statistics there also.

This site has extensive information and features. If you register - dashboard with even more features going to open - there checkout 'Reports' and there 'Modify' tab.

On builtwith lib info sorted by version number.
Case 1: sort them by usage
Case 2: display only ones that used more than in 500,000 of sites

As a user-side script and throw it info GreaseMonkey.

I started to do selection:

function getElementsByStyle(prop, val) {

  /*
  * Example usage:
  *   getElementsByStyle('color', 'rgb(0, 0, 0)')
  *
  */

  var matched = [];
  
  [].forEach.call(document.querySelectorAll('*'), function(node) {
  
    if (getComputedStyle(node)[prop] == val) {
      matched.push(node);
    }
  
  });
  
  return matched;
}

var version_list_block = document.getElementById("mainform")
  .getElementsByTagName("div")
  .getElementsByClassName("container")
  .getElementsByTagName("div")
  .getElementsByClassName("row")
  .getElementsByTagName("div")
  .getElementsByClassName("span4")
  .getElementsByStyle("height", "300px")
  .getElementsByStyle("overflow", "auto");
var version_list = version_list_block
  .getElementsByClassName("row")
  .getElementsByStyle("margin-top", "5px");

but I can't figure-out how to reorder div's inside div using <p> text values.

I also found snippet: https://jsfiddle.net/hibbard_eu/C2heg/, but it is not really understandable for me.

Hope I was in some help for you.

@TriMoon
Copy link

TriMoon commented Apr 28, 2017

You should have linked to a URL with the data your script acts upon.
Without that i'm unable to help in anyway, it's already hard to tell what you wanted...

To reorder HTML tags using DOM, you need to insert/append the DOM-Node into it's place and afterwards remove it from its old position....

@Synzvato
Copy link
Owner

@Anton-Latukha Many thanks a lot for the suggestion! I'll definitely be taking a look at BuiltWith to see if we can combine their metrics with the W3Techs metrics we currently use.

@Synzvato Synzvato changed the title Note about "find out which versions ... are most commonly used on website" BuiltWith serves detailed library usage statistics Jul 10, 2017
@Anton-Latukha
Copy link
Author

Anton-Latukha commented Jul 13, 2017

Thank you so much.

It is concept code. It is about link in text: [https://trends.builtwith.com/javascript/jQuery], and it's section "Version Specific Reports". Parsing version/usage data from it, sort it in usage order.
That it can be put in GreaseMobkey, or Chrome version, and it going to sort things for you automatically on opening Builtwith pages.

Than it also can be used "automagically" (done by hands) to use in a crawler, but that probably an overkill for the task.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants