A small Ruby script that connects to the 42 Intra API and displays a user's validated and non‑validated projects with colored output.
This tool is simple, lightweight, and easy to run on any system.
On Fedora:
sudo dnf install rbenv ruby-build
On Arch / Manjaro:
sudo pacman -S rbenv ruby-build
On Ubuntu / Debian:
sudo apt install rbenv ruby-build
Then add rbenv to your shell:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init - bash)"' >> ~/.bashrc
source ~/.bashrc
or:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zhsrc
echo 'eval "$(rbenv init - zsh)"' >> ~/.zshrc
source ~/.zshrc
- Ruby 3.3.x (recommended)
rbenv install 3.3.10
rbenv local 3.3.10
- Bundler
gem install bundler
Create a .env file in the project folder with the following content:
UID=your_api_uid_here
SECRET=your_api_secret_here
You can generate these credentials from your 42 profile under “OAuth Applications”.
git clone https://github.com/itzksade/42_api.git
cd 42_api
bundle install
./42_api_viewer.rb <login>
or
bundle exec ruby 42_api_viewer.rb <login>
The script will show:
- ✔ Validated projects (green)
- ✘ Non‑validated projects (red)
- Final marks for each project
- The script uses the OAuth2 client_credentials flow
- Colors work in most terminals (Linux, macOS, WSL)
- You can make the script executable with chmod +x if you prefer running it directly
Free to use and modify.