nelsonic / github-scraper

🕷 🕸 crawl GitHub web pages for insights we can't GET from the API ... 💡
432 stars 96 forks source link

Parse Detail of Pinned Repositiories #78

Open nelsonic opened 7 years ago

nelsonic commented 7 years ago

e.g: image

So far we've got the URL of the pinned repo. we would also like to get:

Rob-Rychs commented 6 years ago

Was looking at this earlier today,

// Pinned Repos
  data.pinned = [];
  var p = '.pinned-repo-item-content:nth-of-type(' // is this being used?
  var urls = $('.pinned-repo-item-content a.text-bold')
  var language_color = $('.repo-language-color')
  for (var i = 0; i < $('.pinned-repo-item-content').length; i++) {
    var pin = {
      url: urls[i].attribs.href,
      // Want More? see: https://github.com/nelsonic/github-scraper/issues/78
      language: language_color[i].css('backgroundColor'),
      // stars: ,
      // desc: ,
      // forks: 
    }
    data.pinned.push(pin);
  }

Figured if I could get the backgroundColor I could use this to get the language without having to even think about selecting the lang while dealing with this kind of garbage whitespace...

            JavaScript

image

But I'm having trouble getting the backgroundColor from $('.repo-language-color')...