Skip to content

Commit 8f07bdc

Browse files
committed
Megatron
0 parents  commit 8f07bdc

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

env.template

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CLIENT_ID=<YOUR_CLIENT_ID>
2+
CLIENT_SECRET=<YOUR_CLIENT_SECRET>

megatron

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
MONTH=$1
4+
YEAR=$2
5+
6+
TOKEN=$(curl -s -X POST --data "grant_type=client_credentials&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET" https://api.intra.42.fr/oauth/token | jq '.access_token' | tr -d '"')
7+
8+
curl -s -g -H "Authorization: Bearer $TOKEN" "https://api.intra.42.fr/v2/achievements/63/users?page=1&filter[pool_year]=$YEAR&filter[pool_month]=$MONTH&filter[primary_campus_id]=22" | jq ".[].login"

0 commit comments

Comments
 (0)