iserv2go
An unofficial Go library and CLI for IServ.
Disclaimer 1: I am not affiliated with the IServ GmbH in any way.
Disclaimer 2: This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
Disclaimer 3: Use it at YOUR OWN RISK!
Use as CLI
iserv2go [options] command [arguments...]
List of options
Option | Description |
---|---|
-enable-email |
enables the email functionality |
-enable-files |
enables the files functionality |
-enable-web |
enables other functions (notifications, exercises, etc) |
-info |
shows program info |
-interactive |
starts interactive console where you can type commands instead of passing them as arguments |
-save-sessions |
saves login cookies on the hard drive for subsequent logins |
List of commands
Command | Arguments | Description |
---|---|---|
email.list_mailboxes |
none | get a list of mailboxes |
email.read_mailbox |
mailbox path |
get last 50 messages from mailbox |
email.send_mail |
recipient address , subject , body |
send email |
files.cat |
filename |
print contents of file |
files.download |
iserv path , local path |
download file from IServ |
files.ls |
directory |
list of files in directory |
files.upload |
local path , iserv path |
upload file to IServ |
web.get_badges |
none | get badges (for modules on the nav bar left) |
web.get_current_exercises |
none | list of current exercises |
web.get_notifications |
none | get unread notifications |
web.get_past_exercises |
none | list of past exercises |
web.get_upcoming_events |
none | list of upcoming events |
Use as Library
Install
# in your project directory
go get github.com/alexcoder04/iserv2go/iserv
Example usage
package main
import (
"fmt"
"github.com/alexcoder04/iserv2go/iserv"
"github.com/alexcoder04/iserv2go/iserv/types"
)
func main(){
// create new client instance
client := iserv.Client{}
// login your client
err := client.Login(&types.ClientConfig{
IServHost: os.Getenv("ISERV_HOST"),
Username: os.Getenv("ISERV_USERNAME"),
Password: os.Getenv("ISERV_PASSWORD"),
EnableModules: map[string]bool{
"email": true,
"files": false,
"web": false,
},
SaveSessions: true,
})
if err != nil {
fmt.Println("failed to login")
return
}
// don't forget to logout
defer client.Logout()
// get 10 last mails in INBOX
messages, err := client.Email.ReadMailbox("INBOX", 10)
if err != nil {
return
}
// print them
for _, m := range messages {
fmt.Printf(" = '%s' from %s\n", m.Envelope.Subject, m.Envelope.Sender[0].Address())
}
}
Project Structure
The iserv
folder contains the Go Library, the subfolders email
, files
, web
are modules, which can be (de-)activated separately. They contain each user.go
files, which include all the functions meant to be used by end-user.
Contributing
Contributions are always welcome, there are a lot of things that wait to be implemented, see the issues. I am also looking for co-maintainers and someone to test the project extensively :)
Credits
Contributors
Libraries
- goquery - parsing the html pages to extract information
- go-imap - receive emails
- gowebdav - work with files
Bump golang.org/x/net from 0.6.0 to 0.7.0
Bumps golang.org/x/net from 0.6.0 to 0.7.0.
Commits
8e2b117
http2/hpack: avoid quadratic complexity in hpack decoding547e7ed
http2: avoid referencing ResponseWrite.Write parameter after returning39940ad
html: parse comments per HTML specDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.Bump github.com/PuerkitoBio/goquery from 1.8.0 to 1.8.1
Bumps github.com/PuerkitoBio/goquery from 1.8.0 to 1.8.1.
Release notes
Sourced from github.com/PuerkitoBio/goquery's releases.
Commits
39fb6d4
Prepare for patch release33955be
Merge pull request #439 from PuerkitoBio/dependabot/go_modules/golang.org/x/n...015f32a
Bump golang.org/x/net from 0.2.0 to 0.7.03b7929a
Merge pull request #434 from PuerkitoBio/update-go53d8b4d
Update Go versions used in CIb103c0e
Merge remote-tracking branch 'refs/remotes/origin/master'36e9563
Update goquery dependencies156fa4f
Merge pull request #416 from davemolk/readme-add-goGetJSc76525c
add goGetJS to readme3920ccc
Merge pull request #415 from jakopako/add-goskyr-to-related-projectsDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)Bump golang.org/x/net from 0.5.0 to 0.6.0
Bumps golang.org/x/net from 0.5.0 to 0.6.0.
Commits
87ce33e
go.mod: update golang.org/x dependencies415cb6d
all: fix some comments7e3c19c
all: correct typos in comments296f09a
http2: case insensitive handling for 100-continuef8411da
nettest: fix tests on dragonfly and js/wasmDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)Bump github.com/joho/godotenv from 1.4.0 to 1.5.1
Bumps github.com/joho/godotenv from 1.4.0 to 1.5.1.
Release notes
Sourced from github.com/joho/godotenv's releases.
... (truncated)
Commits
3fc4292
Fix bug where internal unquoted whitespace truncates values (#205)b311b26
Fix: ioutil.ReadAll() is deprecated, so removed it's dependency (#202)4321598
add overload flag (#200)32a3b9b
fix whitespace with gofmt (#203)06bf2d6
Update CI to test go 1.20 (#201)cc9e9b7
Multiline string support (#156)0f21d20
fix tiny details (#199)5c76d3e
Add punctuation to please godoc (#197)85a2237
sort go import in readme (#193)add39c6
Remove power8 again as it wasn't fixedDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)Bump golang.org/x/net from 0.4.0 to 0.5.0
Bumps golang.org/x/net from 0.4.0 to 0.5.0.
Commits
8e0e7d8
go.mod: update golang.org/x dependencies7805fdc
http2: rewrite inbound flow control tracking2aa8215
nettest: use RoutedInterface for probing network stack capabilityad92d3d
websocket: don't recommend Gorillae1ec361
http2: fix race in TestCanonicalHeaderCacheGrowthDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)Bump golang.org/x/net from 0.2.0 to 0.4.0
Bumps golang.org/x/net from 0.2.0 to 0.4.0.
Commits
1e63c2f
http2: limit canonical header cache by bytes, not entries3247b5b
go.mod: update golang.org/x dependenciesecf7fda
http2: deflake TestTransportMaxFrameReadSize0833b63
publicsuffix: embed table dataecf091a
publicsuffix: update table to latest list from publicsuffix.org2f8c3d1
http2: add Transport.MaxReadFrameSize configuration setting0e478a2
http2: add SETTINGS_HEADER_TABLE_SIZE supportDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)TODOs