-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import crypto from "crypto"; | ||
import fs from "fs"; | ||
|
||
const raw = fs.readFileSync("data.txt", "utf-8"); | ||
|
||
const parseData = () => { | ||
const students = raw.split("\r\n").filter(Boolean); | ||
return students.map((student) => { | ||
const [name, uid] = student.split("="); | ||
return { | ||
name, | ||
uid, | ||
}; | ||
}); | ||
}; | ||
|
||
const data = parseData(); | ||
|
||
import teams from "../src/config/teams.js"; | ||
let newTeams = teams; | ||
|
||
newTeams.forEach((team) => { | ||
team.members = team.members.map((member) => { | ||
const student = data.find((student) => student.name === member.name); | ||
if (student) { | ||
const uid = student.uid; | ||
const hash = crypto.createHash("md5").update(student.uid).digest("hex"); | ||
const newMember = { | ||
uid, | ||
hash, | ||
...member, | ||
}; | ||
return newMember; | ||
} | ||
}); | ||
}); | ||
|
||
fs.writeFileSync( | ||
"../src/config/teams.js", | ||
` | ||
// Avatar Map: https://github.com/mantinedev/mantine/tree/master/.demo/avatars | ||
// M: 1 2 3 9 10 | ||
// F: 4 5 6 7 8 | ||
const teams = ${JSON.stringify(newTeams, null, 2)}; | ||
export default teams; | ||
` | ||
); | ||
|
||
// console.log(JSON.stringify(newTeams, null, 2)); | ||
newTeams.forEach((team) => { | ||
console.log(team); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Dibyataru Chakraborty=2024000000 | ||
Soumyadeep Dutta=2024000001 | ||
Salini Dutta=2024000002 | ||
Arpita Paul=2024000003 | ||
Annesha Das=2024000004 | ||
Soumili Saha=2024000005 | ||
Sachin Gupta=2024000006 | ||
Samim Biswas=2024000007 | ||
Sneha Karmakar=2024000008 | ||
Prachi Jha=2024000009 | ||
Shekhar Shubham Thakur=2024000010 | ||
Sayan Paul=2024000011 | ||
Anindya Saha=2024000012 | ||
Sinjini Ghosh=2024000013 | ||
Sneha Das=2024000014 | ||
Debankan Mullick=2024000015 | ||
Anusha Gupta=2024000016 | ||
Shuvajit Chakraborty=2024000017 | ||
Bindiya Mishra=2024000018 | ||
Sneha Kundu=2024000019 | ||
Tamoghni Mukherjee=2024000020 | ||
Rima Bachar=2024000021 | ||
Adrija Ghosal=2024000022 | ||
Adrija Karmakar=2024000023 | ||
Bidish Chakraborty=2024000024 | ||
Yashvi Dubey=2024000025 | ||
Ankita Bera=2024000026 | ||
Soumi Biswas=2024000027 | ||
Avik Samanta=2024000028 | ||
Raj Sekhar Paul=2024000029 | ||
Praveen Joshi=2024000030 | ||
Rajdeep Saha=2024000031 | ||
Gourav Kundu=2024000032 | ||
Arghyadeep Naskar=2024000033 | ||
Krishnendu Das=2024000034 | ||
Jyotipriya Biswas=2024000035 | ||
Aman Kumar Rai=2024000036 | ||
Monami Nandy=2024000037 | ||
Debangshu Roy=2024000038 | ||
Debanjan Mondal=2024000039 | ||
Manobendra Mandal=2024000040 | ||
Hritom Bhattacharya=2024000041 |