Code Monkey home page Code Monkey logo

classeviva's People

Contributors

dependabot[bot] avatar zmoog avatar

Watchers

 avatar  avatar

classeviva's Issues

Filter grades by subject

For example:

$ classeviva grades list --subject-like inglese
+------------+-------+-----------------+---------------------------------+
| DATE       | GRADE | SUBJECT         | NOTES                           |
+------------+-------+-----------------+---------------------------------+
| 2022-05-09 | 8-    | INGLESE         |                                 |
+------------+-------+-----------------+---------------------------------+

203:CvvRestApi/unrecognized apikey

The last successful execution happened on Mac 15, 2023. After this date, every time I try to access the API I get the following error:

$ classeviva grades list
Error: fetcher: failed to fetch identity (status_code: 400)

I tried to repeat the API call with an HTTP client, and here's the full response:

{
    "statusCode": 400,
    "error": "203:CvvRestApi/unrecognized apikey"
}

It seems the following HTTP header is no longer valid:

req.Header.Add("Z-Dev-Apikey", "+zorro+")

Build a simple prototype that lists grades as JSON

For example:

$ classeviva grades list
[
  {
    "subjectDesc": "ITALIANO",
    "evtDate": "2022-04-11",
    "decimalValue": 9.25,
    "displayValue": "9+",
    "color": "green",
    "skillValueDesc": " ",
    "notesForFamily": "verifica grammatica (soggetto-predicati)"
  },
 ...
]

Filter by period

Grades and possibly other data are archived by period ("quadrimestre", in Italy).

Filter grades by period is needed.

Grades statistics

For example:

  • calculate average by subject;
  • for each subject, report the trend (+, -, =)

Error messages are not useful

When I run the tool on a cloud provider 1 I get the following error:

$ classeviva grades list -d
DEBU[0000] Looking for an existing identity..
DEBU[0000] settings path is: [/home/azureuser/.classeviva]
DEBU[0000] identity file [/home/azureuser/.classeviva/identity.json] does not exist
DEBU[0000] exists: false
DEBU[0000] expire
DEBU[0000] now2022-05-03T20:28:23Z
DEBU[0000] fetching new identity
TRAC[0000] <HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>

You don't have permission to access "http&#58;&#47;&#47;web&#46;spaggiari&#46;eu&#47;rest&#47;v1&#47;auth&#47;login&#47;" on this server.<P>
Reference&#32;&#35;18&#46;a6b93554&#46;1651609703&#46;877e15
</BODY>
</HTML>
Error: invalid character '<' looking for beginning of value
Usage:
  classeviva grades list [flags]

Flags:
  -h, --help        help for list
  -l, --limit int   Limit number of results (default 3)

Global Flags:
  -d, --debug           Print debug information
  -f, --format string   Output format (default "text")

invalid character '<' looking for beginning of value

The issue is caused by the HTML response instead of JSON, but the error is not helping.

Footnotes

  1. the root cause is https://web.spaggiari.eu not allowing source IP addresses from cloud providers (tested on AWS and Azure). โ†ฉ

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.