Crates.io | ripinfo |
lib.rs | ripinfo |
version | 0.1.1 |
source | src |
created_at | 2023-03-09 15:38:47.444356 |
updated_at | 2023-03-09 18:14:16.208073 |
description | ripinfo is a tool to gather ip information using the ipinfo.io API |
homepage | https://github.com/Gers2017/ripinfo |
repository | https://github.com/Gers2017/ripinfo |
max_upload_size | |
id | 805740 |
size | 223,701 |
A personal tool to gather ip information using the ipinfo.io API written in rust™
Ripinfo can be installed using cargo
cargo install ripinfo
Ripinfo can get ip information in two modes: demo mode
and token mode
ripinfo_config.json
In order to get an access token you need an account on ipinfo.io. You can create one here: https://ipinfo.io/login
Once you've created your account, you can check your access token here: https://ipinfo.io/account/token
By default ripinfo uses demo mode, and in the case that ripinfo_config.json
doesn't exists ripinfo will create it.
To use the ipinfo.io access token create/edit ripinfo_config.json
located at:
# Windows: C:\Users\<USER>\AppData\Roaming\RipInfo\ripinfo\config\ripinfo_config.json
# Linux: /home/<USER>/.config/ripinfo/ripinfo_config.json
# Mac: /Users/<USER>/Library/Application Support/com.RipInfo.ripinfo/ripinfo_config.json
Ripinfo uses the directories crate to get config directory.
Insert following content to ripinfo_config.json
:
{
"use_token": true,
"token": "<YOUR_ACCESS_TOKEN>"
}
Every time a request is successful ripinfo stores the ip data inside
ripinfo.json
(same directory as ripinfo_config.json
).
So the next time you request a cached ip, ripinfo will return the cached ip data. This is done to save some requests to ipinfo.io and to reduce usage of the ipinfo API.
Since this used to be a personal tool I'd usually delete items from the cache manually. So in the future I'm planning to add commands to bypass the cache and delete specific items from the cache.