Skip to content

tomsarry/kattis-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

kattis-scraper

๐Ÿ”Ž Kattis web scraper.

(Currently) A CLI kattis Web Scraper that gives all solved problems of a user, along with their difficulty and their URL.

Getting started

Make sure you have Go installed on your machine (1.14+), and that $PATH leads to your binary go files.

$ go get github.com/tomsarry/kattis-scraper
$ go install github.com/tomsarry/kattis-scraper

You should add a .env file with two parameters :

EMAIL:email
PASSWORD:password

where email is your Kattis email, and password is your kattis password.

How to use it

Simply run the following

$ kattis-scrapper

Currently returns a difficulty-sorted list of your solved problems (alphabetically, increasing difficulty or decreasing difficulty ordering possible).

โš ๏ธ Note: Make sure to have the .env file in that location.

Example

$ kattis-scrapper
1: Hello World!, 1.2, https://open.kattis.com/problems/hello
2: Planina, 1.3, https://open.kattis.com/problems/planina
3: Cold-puter Science, 1.3, https://open.kattis.com/problems/cold
4: Pot, 1.3, https://open.kattis.com/problems/pot
5: Quality-Adjusted Life-Year, 1.3, https://open.kattis.com/problems/qaly
6: Piece of Cake!, 1.3, https://open.kattis.com/problems/pieceofcake2
7: Detailed Differences, 1.4, https://open.kattis.com/problems/detaileddifferences
8: Simon Says, 1.4, https://open.kattis.com/problems/simonsays
9: No Duplicates, 1.4, https://open.kattis.com/problems/nodup
10: Spavanac, 1.4, https://open.kattis.com/problems/spavanac
11: Solving for Carrots, 1.4, https://open.kattis.com/problems/carrots
12: Oddities, 1.4, https://open.kattis.com/problems/oddities
13: Soda Slurper, 1.5, https://open.kattis.com/problems/sodaslurper

Behaviour for Unexpected Results

Here are some explanations for weird results of the program:

Difficulty of 0 on a problem ?

Scraper could not parse the difficulty of the problem, it may be related to some weird notations like this one (TODO):

Unprecise difficulty

Not a valid link for a problem ?

Scraper could not parse the link associated with the problem.

Todo's

Here are the next steps for this project, ranked by difficulty (assumption):

EASY

  • Add sort by difficulty, increasing or decreasing.
  • Add sort by inverse alphabetical order.

MEDIUM

  • Turn it into an API -> json response file.

HARD

  • Make it work with 100+ solved problems (multiple pages).

About

๐Ÿ”Ž Kattis web scraper

Resources

Stars

Watchers

Forks

Languages