ripinfo

Crates.ioripinfo
lib.rsripinfo
version0.1.1
sourcesrc
created_at2023-03-09 15:38:47.444356
updated_at2023-03-09 18:14:16.208073
descriptionripinfo is a tool to gather ip information using the ipinfo.io API
homepagehttps://github.com/Gers2017/ripinfo
repositoryhttps://github.com/Gers2017/ripinfo
max_upload_size
id805740
size223,701
Gers (Gers2017)

documentation

README

Ripinfo

A personal tool to gather ip information using the ipinfo.io API written in rust™

command gif

Installation

Ripinfo can be installed using cargo

cargo install ripinfo

Configuration

Ripinfo can get ip information in two modes: demo mode and token mode

Demo Mode

Token Mode

  • uses the access token to get the data
  • response depends on your plan
  • requires you to configure ripinfo_config.json

How to get an access token?

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

Configure ripinfo_config.json

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>"
}

About Caching ⚠️

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.

Commit count: 18

cargo fmt