atcoder

package
v0.0.0-...-d7a13fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Base = "https://atcoder.jp"

	LoginPath              = "/login"
	TaskPathFormat         = "/contests/%s/tasks/%s"       // contestId, taskId
	SubmissionMePathFormat = "/contests/%s/submissions/me" // contestId
)

Variables

This section is empty.

Functions

func GetContestIdFromTask

func GetContestIdFromTask(url string) string

func GetTaskIdFromTask

func GetTaskIdFromTask(url string) string

func IsTask

func IsTask(url string) bool

func Login

func Login() string

func Ltoi

func Ltoi(lang ccc.Lang) (string, error)

Ltoi converts ccc.Language to AtCoder lang id.

func SubmissionMePath

func SubmissionMePath(contestId string) string

func TaskPath

func TaskPath(contestId, taskId string) string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(username, password string, logger *log.Logger) (*Client, error)

func (*Client) GetSubmission

func (c *Client) GetSubmission(ctx context.Context, baseTime *time.Time) (*ccc.Submission, error)

func (*Client) Login

func (c *Client) Login(ctx context.Context) error

func (*Client) Submit

func (c *Client) Submit(ctx context.Context, task *Task, code *ccc.Code) (*time.Time, error)

type LoginForm

type LoginForm struct {
	*goquery.Selection
}

func (*LoginForm) CSRFToken

func (form *LoginForm) CSRFToken() string

type LoginPage

type LoginPage struct {
	*goquery.Document
}

func NewLoginPage

func NewLoginPage(r io.Reader) (*LoginPage, error)

func (*LoginPage) LoginForm

func (p *LoginPage) LoginForm() *LoginForm

type SubmitForm

type SubmitForm struct {
	*goquery.Selection
}

func (*SubmitForm) CSRFToken

func (form *SubmitForm) CSRFToken() string

type Task

type Task struct {
	ContestId string
	TaskId    string
}

func NewTaskFromUrl

func NewTaskFromUrl(taskUrl string) (*Task, error)

type TaskPage

type TaskPage struct {
	*goquery.Document
}

func NewTaskPage

func NewTaskPage(r io.Reader) (*TaskPage, error)

func (*TaskPage) SubmitForm

func (p *TaskPage) SubmitForm() *SubmitForm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL