Git Product home page Git Product logo

ripinfo's Introduction

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.

ripinfo's People

Contributors

gers2017 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.