-
Notifications
You must be signed in to change notification settings - Fork 0
/
confounders_repos.js
70 lines (56 loc) · 2.27 KB
/
confounders_repos.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* Created by ksdmitrieva on 04/25/2017.
*/
var fs = require("fs");
var _ = require('lodash');
//processAngularRepos();
//processJadeRepos();
processEJSrepos();
function processAngularRepos() {
const inputFile = "./resultfiles/filteredResults_2017.02.28_Angular_Blog_CMS_withJSbackend - 53.json";
const outputFile = "repos_angular.csv";
var results = require(inputFile);
console.log("results "+results.length);
var repo;
for( var i=0; i < results.length; i++) {
repo = results[i];
//console.log(repo.full_name+","+repo.size+","+repo.stargazers_count+","+repo.forks);
fs.appendFileSync(outputFile, repo.full_name+","+repo.name+","+repo.size+","+repo.stargazers_count+","+repo.forks+"\n");
}
}
function processJadeRepos() {
const inputFile = "./resultfiles/filteredResults_2016.11.08_noAngular - 186.json";
const inputRepos = "repos_jade.txt";
const outputFile = "repos_jade.csv"; //"repos_ejs.csv"
var results = require(inputFile);
console.log("All Repos: "+results.length);
var reposData = fs.readFileSync(inputRepos, 'utf8');
var repos = reposData.split('\r\n');
console.log("Jade Repos: "+repos.length);
var repo;
for( var i=0; i < results.length; i++) {
repo = results[i];
if (_.indexOf(repos, repo.full_name) > -1 ) {
//console.log(repo.full_name);
fs.appendFileSync(outputFile, repo.full_name+","+repo.name+","+repo.size+","+repo.stargazers_count+","+repo.forks+"\n");
}
}
}
function processEJSrepos() {
const inputFile = "./resultfiles/filteredResults_2016.11.08_noAngular - 186.json";
const inputRepos = "repos_ejs.txt";
const outputFile = "repos_ejs.csv"; //"repos_ejs.csv"
var results = require(inputFile);
console.log("All Repos: "+results.length);
var reposData = fs.readFileSync(inputRepos, 'utf8');
var repos = reposData.split('\r\n');
console.log("EJS Repos: "+repos.length);
var repo;
for( var i=0; i < results.length; i++) {
repo = results[i];
if (_.indexOf(repos, repo.full_name) > -1 ) {
//console.log(repo.full_name);
fs.appendFileSync(outputFile, repo.full_name+","+repo.name+","+repo.size+","+repo.stargazers_count+","+repo.forks+"\n");
}
}
}