Skip to content

Commit

Permalink
Added additional download logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Asimov4 committed Sep 28, 2014
1 parent f4dbc47 commit 514d202
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions static/importing/index.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ <h4 class="company">' + company.name + '</h4> \
IN.API.PeopleSearch() IN.API.PeopleSearch()
.fields("id", "last-modified-timestamp", "location","firstName", "lastName", "headline", "industry", "positions", "picture-url", "summary", "associations", "languages", "publications", "skills", "certifications", "educations", "courses", "volunteer", "three-current-positions", "three-past-positions", "recommendations-received", "following", "date-of-birth", "honors-awards") .fields("id", "last-modified-timestamp", "location","firstName", "lastName", "headline", "industry", "positions", "picture-url", "summary", "associations", "languages", "publications", "skills", "certifications", "educations", "courses", "volunteer", "three-current-positions", "three-past-positions", "recommendations-received", "following", "date-of-birth", "honors-awards")
.params({ .params({
"keywords": document.searchform.dream.value, "company-name": document.searchform.dream.value,
"current-company": true,
"count": 25, "count": 25,
"start": start "start": start
}) })
Expand All @@ -145,13 +146,30 @@ <h4 class="company">' + company.name + '</h4> \
return; return;
} }


performPeopleSearchCall(0); for (i=0;i<4;i++) {
performPeopleSearchCall(25); performPeopleSearchCall(i*25);
performPeopleSearchCall(50); }
performPeopleSearchCall(75);


} }


function indexData(profile) {
$.ajax({
url: "http://api.genderize.io?name=" + profile.firstName,
method: "GET",
success: function(genderize) {
var anonymizedProfile = profile;
anonymizedProfile["gender"] = genderize.gender;
delete anonymizedProfile.firstName;
delete anonymizedProfile.lastName;
$.ajax({
url: "http://elasticsearch.kibana.co/li/profile/" + profile.id,
method: "POST",
data: JSON.stringify(anonymizedProfile)
})
}
});
}

function setSearchResults(result, metadata) { function setSearchResults(result, metadata) {
personsHTML = "<div class='section-group'><h3>" + result.numResults + " people in your extended network have already made it there! You should talk to:</h3>"; personsHTML = "<div class='section-group'><h3>" + result.numResults + " people in your extended network have already made it there! You should talk to:</h3>";
companiesHTML = "<div class='section-group'><h3>Companies that they have worked for:</h3><ul class='ul-exp list-media unstyled'>"; companiesHTML = "<div class='section-group'><h3>Companies that they have worked for:</h3><ul class='ul-exp list-media unstyled'>";
Expand All @@ -160,14 +178,7 @@ <h4 class="company">' + company.name + '</h4> \
var titles = {}; var titles = {};
for (i in result.people.values) { for (i in result.people.values) {


anonymizedProfile = result.people.values[i]; indexData(result.people.values[i]);
delete anonymizedProfile.firstName;
delete anonymizedProfile.lastName;
$.ajax({
url: "http://elasticsearch.kibana.co/li/profile/" + result.people.values[i].id,
method: "POST",
data: JSON.stringify(anonymizedProfile)
});


try { try {
$.each(result.people.values[i].positions.values, function(i,position) { $.each(result.people.values[i].positions.values, function(i,position) {
Expand Down

0 comments on commit 514d202

Please sign in to comment.