Giter VIP home page Giter VIP logo

hackerrank-dl's Introduction

HackerRank Submission Downloader

HackerRank Submission Downloader allows you to download submissions for a contest in HackerRank.

The tool organizes the submissions according to the problem name and their programming language and then by account name.

For example,

out/2020-03-01-06-01
├── a-walk-to-remember-1
│   ├── c
│   │   ├── Cygnus_UOK.c
│   │   ├── KingCoders_SEUSL.c
│   │   └── StackTrace_NSBM_.c
│   ├── cpp
│   │   ├── BlackHawks_USJ.cpp
│   │   ├── Code_Clan_RUSL.cpp
│   │   ├── Cyborgs_USJ.cpp
│   │   ├── FRIDAY_USJ.cpp
│   │   ├── JPAC_UOP.cpp
│   │   ├── Paradox_UOJ.cpp
│   │   └── XCODERS_UOP.cpp
│   ├── csharp
│   │   └── CodeMart_UOR.cs

Development

This tool was written in Go

  1. Install Golang 1.14 or newer
  2. Clone the repo in your local machine
  3. Run go build to build binary for your platform

To cross compile

Run chmod +x ./build/build.sh && ./build/build.sh

How to use

Download binary for your platform from release page (or build yourself 🔨).

The usage of the tool is simple. You have to provide a config.yaml in your current working directory and tool will pick this up. config.yaml contains all the necessary info to download submissions from a hackerrank contest.

Note: You should be a moderator or an administrator of the contest in order to use this tool for download submissions

sample config file config.yaml is shown below

# slug name of the contest
contest: our-contest
# browser cookies for HackerRank as semicolon seperated string
cookies: >-
  abc=123; xyz=123;
# output directory
output: results
# limit 5 parallel download threads
parallelDownloads: 5 
# wait time between downloads in seconds
waitTime: 1 
# burst per wait time
rate: 10 

Run ./hackerrank-dl with config.yaml in the working directory to start the magic.

How to get contest slug name

  1. Go to HackerRank
  2. Go to your contest
  3. Slug name is in the pattern of https://www.hackerrank.com/aces-coders-v8
  4. In here aces-coders-v8 is the slug name
  5. Copy it and use it in config.yaml

How to get HackerRank browser cookies

HackerRank does not provide a public API, thus we have to use browser cookies for authentication

Following instructions are based on Chrome

  1. Open Chrome
  2. Login to HackerRank
  3. Make sure you are an admin/moderator of your contest
  4. Install EditThisCookie browser extension for chrome
  5. Open extension
  6. Click Settings Icon
  7. Set Choose preferred export format for cookies to Semicolon seperated name=value pairs
  8. Open up https://hackerrank.com
  9. Open EditThisCookie extension
  10. Click Export button (arrow out)
  11. Paste the value for cookies in config.yaml

hackerrank-dl's People

Contributors

kasvith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hackerrank-dl's Issues

error parsing config file

Hey @kasvith. First of all thank you for creating this tool! I am attempting to extract data and I believe I did everything correctly and I am still getting an error message: level=fatal msg="error parsing config file, yaml: line 6: could not find expected ':'" Any idea how I could resolve it? You can email me at [email protected] and I can send you a screenshot of my config file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.