Skip to content

Instantly share code, notes, and snippets.

@Warafux
Last active May 2, 2019 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Warafux/9f7694a960ebcd5deca5eb80f7ef7b7a to your computer and use it in GitHub Desktop.
Save Warafux/9f7694a960ebcd5deca5eb80f7ef7b7a to your computer and use it in GitHub Desktop.
Web Scrapper Github Projects with JQuery
//get project name:
$("[data-hovercard-type=project]").html().trim()
//get project columns:
$("div.project-column")
//get boxes in columns:
$(column).find("div.pl-5")
//get column name:
$(column).find(".js-project-column-name").text()
//get boxes content in columns:
$(box).find("p").text()
//Example:
var columns = $("div.project-column")
var t = ""
t += $("[data-hovercard-type=project]").html().trim();
columns.each(function(index) {
var boxes = $(this).find("div.pl-5")
t += "\n-- "+$(this).find(".js-project-column-name").text()
boxes.each(function(index) {
t += "\n---- "+$(this).find("p").text().replace(/(\r\n|\n|\r)/gm, "")
})
})
console.log(t)
@Warafux
Copy link
Author

Warafux commented May 2, 2019

This gists will allow anyone to "easy" export projects from the projects section of a repo.
Checkbox and another more complex card structures are not correctly exported...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment