This repository contains a script to generate reports from vJudge contests. This script was developed when I was a teaching assistant of the course "Programming Challenges II" or MC621. The script main.py was implemented in python 3 using the library BeautifulSoup.
To use the script, follow the steps:
- First, you have to download the full loaded contest HTML files you wish to generate the report.
- Click at the tab 'Rank'.
- And then, download the page at the contests folder by pressings Ctrl + s, make sure that the option "Webpage, Complete" at the right bottom of the pop-up is selected:
Step 2 is a mandatory requirement for the script correct execution because the rank tab content is loaded through Ajax.
- In the file main.py, the cookies dictionary contains the cookies information required to perform the HTTP requests, to find the right values to these fields:
- Go to the vJudge.net;
- Sign in;
- Open the browser page inspector (Ctrl + Shift + i on chrome);
- Select the Application tab
- At the Storage section, select the Cookies > http://vjudge.net subsection,
- And copy and paste the fields Jax.Q, _gid, JSESSIONID, and _ga values to the cookies dictionary. As the image below presents:
- The contests array contains the directory to the contests HTML files.
contests = [
'contests/MC621_MC821_08_11 - Virtual Judge.HTML',
]
Fill this array with your downloaded files directories.
- The usernames array contains the list of vJudge contests usernames.
usernames = [
'LuizAndia',
'b164923',
'hboschirolli',
];
Fill this array with the vJudge contests usernames.
-
The usernames_to_present array contains the usernames presentation order allowing you to insert some break lines between the names.
-
Now, run python main.py and open the generated .csv.
8.1. Case you want to see the program logs while it runs, you can run with the verbose argument (python main.py --verbose).
Any doubts feel yourself free to reach me out: [email protected]