summaryrefslogtreecommitdiff
path: root/chphoto/README.md
blob: 00f352f2eb02d18e77a5a2563f5e1b9dead313f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# chphoto

This simple program allows you to change profile pictures on the YK Pao School outlook directory.

## Authentication

Please run without `-passvar` when using for the first time, as interactive authentication is required for the application to receive consent. Subsequent runs may use pasword authentication, for example, for automation purposes.

## Usage

```
Usage of ./chphoto:
  -email string
    	(required) username@ykpaoschool.cn
  -passvar string
    	environment variable containing the password
  -photo string
    	(required) path to avatar
```

## Note on daily reset

The profile pictures are reset approximately every day. Use a cron job, or otherwise run this script frequently, to make the change persist.

```crontab
0 * * * * $HOME/cronstuff/chphoto.sh
```

```sh
cd $HOME/cronstuff/
pass=XXXXXXXXXXXXXXX ./tooch/chphoto/chphoto -passvar pass -email sXXXXX@ykpaoschool.cn -photo ./tooch/chphoto/sjdb-avatar.png
```