Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

Add contributions map as an option #30

Open
@hacdias

Description

@hacdias

Base code to convert to PHP:

/* Github Calendar */
var username = "hacdias";
var url = "https://github.com/" + username;

var fetchCalendar = () => httpsRequest(url, (body) => {
  let $ = cheerio.load(body);
  let cal = $("#contributions-calendar");
  $("#contributions-calendar .left.text-muted").html(`Summary of pull requests, issues opened, and commits made by <a href="https://github.com/${username}" target="blank">@${username}</a>`);

  if (cal.find("include-fragment").length) {
    setTimeout(fetchCalendar, 500);
  } else {
    let h = $('.js-calendar-graph-svg').attr('height');
    let w = $('.js-calendar-graph-svg').attr('width');
    $('.js-calendar-graph-svg').attr('viewBox', '0 0 ' + w + ' ' + h);
    fs.writeFile("layouts/partials/github.html", $("#contributions-calendar").html());
  }
});

fetchCalendar();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions