{"size": 1021, "ext": "js", "max_stars_repo_path": "src/build/generate.js", "max_stars_repo_name": "rufenmatt/ml-arxiv-papers", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/build/generate.js", "max_issues_repo_name": "rufenmatt/ml-arxiv-papers", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/build/generate.js", "max_forks_repo_name": "rufenmatt/ml-arxiv-papers", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.1794871795, "max_line_length": 89, "alphanum_fraction": 0.5475024486}
(function () {

  const arxiv = require('arxiv-api');

  const paper = arxiv
    .search({
      searchQueryParams: [
        {
          include: [{ name: 'Machine Learning' }],
        },
      ],
      start: 0,
      maxResults: 100,
    })
    .then((paper) => {
      console.log(paper);

      const btn = document.getElementById("shuffle-btn");
      const btnRead = document.getElementById("read-btn");

      var i = -1;

      btn.addEventListener("click", function () {
        if (i < paper.length) {
          i += 1;
          document.getElementById("title").textContent = paper[i].title;
          btnRead.setAttribute("href", paper[i].id)
          document.querySelector(".author").textContent = paper[i].authors;
        } else {
          document.getElementById("title").innerHTML = "you went through all for today.";
          btnRead.removeAttribute("href")
          document.querySelector(".author").textContent = "";
        }

      });
    })
    .catch((error) => console.log(error));

})();