|
1 | 1 | // ==UserScript==
|
2 | 2 | // @name Google scholar profile analysis
|
3 | 3 | // @namespace http://tampermonkey.net/
|
4 |
| -// @version 0.4 |
| 4 | +// @version 0.5 |
5 | 5 | // @description Google scholar profile analysis plugin
|
6 | 6 | // @author Haifeng Wang
|
7 | 7 | // @include /^https://scholar.google.com/citations.*user=.*/
|
@@ -45,19 +45,10 @@ function get_coauthors_rate() {
|
45 | 45 | temp_output = temp_output.concat("; ");
|
46 | 46 | // console.log(array_authors[i_author].name, array_authors[i_author].count);
|
47 | 47 | }
|
48 |
| - |
49 |
| - //for (i_word = 0; i_word < array_words.length; i_word++){ |
50 |
| - // if (array_words[i_word].count > 1) { |
51 |
| - // // process.stdout.write(array_words[i_word].name, array_words[i_word].count); |
52 |
| - // temp_output = temp_output.concat(array_words[i_word].name); |
53 |
| - // temp_output = temp_output.concat(": "); |
54 |
| - // temp_output = temp_output.concat(array_words[i_word].count.toString()); |
55 |
| - // temp_output = temp_output.concat(" ;"); |
56 |
| - // //console.log(array_words[i_word].name, array_words[i_word].count); |
57 |
| - // } |
58 |
| - // } |
59 | 48 | console.log("Name count")
|
60 | 49 | console.log(temp_output);
|
| 50 | + var paragraphNames = document.getElementById("paragraphNames"); |
| 51 | + paragraphNames.innerText = temp_output; |
61 | 52 | }
|
62 | 53 |
|
63 | 54 | function get_word_rate() {
|
@@ -90,17 +81,49 @@ function get_word_rate() {
|
90 | 81 | temp_output = temp_output.concat(array_words[i_word].name);
|
91 | 82 | temp_output = temp_output.concat(": ");
|
92 | 83 | temp_output = temp_output.concat(array_words[i_word].count.toString());
|
93 |
| - temp_output = temp_output.concat("; "); |
| 84 | + temp_output = temp_output.concat(";"); |
94 | 85 | //console.log(array_words[i_word].name, array_words[i_word].count);
|
95 | 86 | }
|
96 | 87 | }
|
97 | 88 | console.log("keyword count")
|
98 | 89 | console.log(temp_output);
|
| 90 | + // temp_output.replace("; ", "; \br") |
| 91 | + var paragraphKeywords = document.getElementById("paragraphKeywords"); |
| 92 | + paragraphKeywords.innerText = temp_output; |
| 93 | +} |
| 94 | + |
| 95 | + |
| 96 | +function addInfoContainer() { |
| 97 | + var containerSideBar = document.getElementsByClassName("gsc_rsb")[0]; |
| 98 | + var containerInformation = document.createElement("div"); |
| 99 | + containerInformation.id = "containerInformation"; |
| 100 | + containerInformation.className = "gsc_rsb_s gsc_prf_pnl"; |
| 101 | + containerSideBar.appendChild(containerInformation); |
| 102 | + |
| 103 | + var containerNames = document.createElement("div"); |
| 104 | + containerNames.id = "containerNames"; |
| 105 | + containerSideBar.appendChild(containerNames); |
| 106 | + |
| 107 | + var paragraphNames = document.createElement("p") |
| 108 | + paragraphNames.id = "paragraphNames" |
| 109 | + paragraphNames.className = "gsc_rsb_m_title" |
| 110 | + containerNames.appendChild(paragraphNames) |
| 111 | + |
| 112 | + var containerKeywaords = document.createElement("div"); |
| 113 | + containerKeywaords.id = "containerKeywords"; |
| 114 | + containerSideBar.appendChild(containerKeywaords); |
| 115 | + |
| 116 | + var paragraphKeywords = document.createElement("p"); |
| 117 | + paragraphKeywords.id = "paragraphKeywords"; |
| 118 | + paragraphKeywords.className = "gsc_rsb_m_title" |
| 119 | + containerKeywaords.appendChild(paragraphKeywords); |
| 120 | + |
99 | 121 | }
|
100 | 122 |
|
101 | 123 | (function() {
|
102 | 124 | 'use strict';
|
103 | 125 | // Print author name count
|
| 126 | + addInfoContainer(); |
104 | 127 |
|
105 | 128 | get_coauthors_rate();
|
106 | 129 | // Pring word count
|
|
0 commit comments