Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Code Jam - CLI

Build Status Join the chat at https://gitter.im/Faylixe/googlecodejam-client

Command line application for managing Google Code Jam contest submission based on the googlecodejam-client API.

Disclaimer

Please note that this client is not provided by Google. Any responsability is declined if a bug occurs when you are using it in a real contest condition. This API is fully working in a practice context, but has never been tested in a real contest.

Usage

This command line application consists in the client JAR and a running script is also available. Here is the usage description :

codejam action parameter

Where action belongs to the following option list :

  • --init
  • --download
  • --submit

Please note that Firefox web browser is also required.

Installation

You can install script and packaged version of client by running the following command :

wget -O - https://raw.githubusercontent.com/Faylixe/googlecodejam-cli/master/scripts/install | bash

Once script has been executed, you can run the codejam command. Please note that installation script should be ran under root permission.

If you are not comfortable with running script from an unknown source with root permission, you can just download the last released jar file, and run it using the command :

java -jar googlecodejam-cli.jar action parameters

Initialization action

This action is in charge of retrieving a SACSID cookie value which is mandatory for querying Code Jam platform successfully. This cookie can be either retrieved using :

  • Firefox browser
  • Raw cookie input

By default the Firefox method is used, which will open up a Firefox instance in order to authenticate to Google services. Once Firefox is opened and the login page loaded, please proceed to the authentication process, and when you will be logged and redirected to the code jam home page, Firefox will be closed automatically.

codejam --init

If you want to directly supply the SACSID cookie value you can use the --method parameter :

codejam --init --method text

Once logged you will be prompted to choose a contest and a round. Those will become contextual round and session for the current directory you are running the script in, meaning that if you run another time the script with another action, it will use the created contextual logged session and round.

Download action

As it name suggests, the download action allows logged user to download an input file for a given problem. If the contest is active, then it will trigger the submission timer depending of the input difficulty you have choosen (usually 4 minutes for a small input, 8 for a large one).

The following exemple will download the small input file for the first problem.

codejam --download --problem A --inputtype small

If the download is successful, the name of the downloaded file will be printed, so it could be chained in a command workflow, for example :

cat < `codejam --download --problem A --inputtype small` | python A.py

Submit action

Once input file is downloaded, and algorithm solved all test cases, submit action could be used in order to send either the output file as the source file of your algorithm as well.

codejam --submit --problem A --inputtype small --output path/to/output --sourcefile path/to/sourcefile

Jammy

Want more than a command line application ? Take a look at the Jammy project, which provides a dedicated development perspective in Eclipse IDE.

About

Command line application based on the googlecodejam-client API.

Topics

Resources

Stars

11 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages