diff --git a/README.md b/README.md index 4f140b3..f2687df 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,19 @@ Currently able to extract:- * - [x] `profile data` * - [x] `experience section` * - [x] `education section` -* - [ ] `certifications` +* - [x] `certifications` * - [ ] `volunteer experience` * - [x] `skills section` -* - [ ] `accomplishments` +* - [x] `accomplishments` * - [x] `courses` * - [x] `projects` - * - [ ] `languages` - * - [ ] `test scores` - * - [ ] `awards` + * - [x] `languages` + * - `test scores` _Planning not to extract these until the previous minor release [bug](https://github.com/DrakenWan/Yale3/issues/1) of accomplishment extraction is not fixed_ + * - `awards` _Same as test scores_ + + +removed checkboxes on `test scores` and `awards` section. Planning not to extract these as the information from these is not viable unless the `accomplishments` section bug is fixed with a long term solution. For now assuming that entire `accomplishment` section has been extracted in progress. + +## Bugs + +Some bugs might have crept in. I strive to make the code as general as possible but the extractor tool may not be perfect. If you find any bug on any profile please let me know in [issues](https://github.com/DrakenWan/Yale3/issues) section. \ No newline at end of file diff --git a/scripts/content.js b/scripts/content.js index 66fe38f..ed5d337 100644 --- a/scripts/content.js +++ b/scripts/content.js @@ -317,10 +317,10 @@ function extract() { /// Languages, honor-awards) //first, extract out the array of nodes containing different sections - var coursesection = document.querySelector(".courses") + var coursesection = document.querySelector(".courses"); var projectsection = document.querySelector(".projects"); - // var lang_nodes = acc_nodes[2]?.querySelectorAll("div > ul > li") || null; - // var tests = acc_nodes[3]?.querySelectorAll("div > ul > li") || null; + var languagesection = document.querySelector(".languages"); + //var tests = acc_nodes[3]?.querySelectorAll("div > ul > li") || null; // var awards = acc_nodes[4]?.querySelectorAll("div > ul > li") || null; ///extracting different sections starting with course section @@ -351,23 +351,63 @@ function extract() { } /////PROJECTS EXTRACTION ENDS HERE//// + + ////LANGUAGES EXTRACTION//// + var languages = [] + if(languagesection) { + var lang_nodes = languagesection.querySelectorAll("div > ul > li") || null; + for(var nodo of lang_nodes) { + var language = nodo.textContent; + languages.push( + getCleanText(language) + ); + } + } + ////LANGUAGE EXTRACTION ENDS HERE//// + + var accomplishments = { "courses": courses || [], - "projects": projects || [] + "projects": projects || [], + "languages": languages || [] } - ////Accomplishments extraction ends here - - //add in the extracted object values here - userProfile = { - "profileData": profileData, - "experiences": experiences, - "education": education, - "skills": skills, - "accomplishments" : accomplishments - } + ////Accomplishments extraction ends here + + ///Licences and Certifications Extraction/// + var certnodes = document.querySelectorAll(".pv-profile-section--certifications-section > ul > li"); + var certs = []; + if(certnodes) { //if the section exists or nah + for(var nodo of certnodes) { + var summ1 = nodo.querySelector("div.pv-certifications__summary-info--has-extra-details"); + var summ2 = nodo.querySelector("div.pv-entity__extra-details"); + + var certtitle = summ1?.querySelector("h3")?.textContent || null; + var credurl = summ2?.querySelector("a").href || null; + + certs.push( + { + "title": getCleanText(certtitle), + "url": credurl + } + ); + }//for loop ends + } + + + ///L&C extraction ends here/// + + //add in the extracted object values here + userProfile = { + "profileData": profileData, + "experiences": experiences, + "education": education, + "skills": skills, + "accomplishments" : accomplishments, + "certifications": certs + } - return userProfile; + return userProfile; }//Extract() functions ends here