Code Monkey home page Code Monkey logo

perl's People

Contributors

abdullahdevrel avatar abu-usama avatar awaismslm avatar coderholic avatar deltwalrus avatar gnazarey avatar jhtimmins avatar kianmeng avatar rm-umar avatar st-polina avatar umanshahzad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

perl's Issues

Add optional IP selection handler

Add an optional IP selection handler to the SDK client initialization step which accepts the request context and expects returning an IP.

Add a default handler for this which looks at the X-Forwarded-For header and falls back to the source IP.

The resulting IP is the IP for which details are fetched.

Add optional IP selection handler

Add an optional IP selection handler to the SDK client initialization step which accepts the request context and expects returning an IP.

Add a default handler for this which looks at the X-Forwarded-For header and falls back to the source IP.

The resulting IP is the IP for which details are fetched.

Error during library use without token

I try to execute the following example present in the documentation:

use Geo::IPinfo;

$ipinfo = Geo::IPinfo->new();
$details = $ipinfo->info('8.8.8.8');

if (defined $details)   # valid data returned
{
  $city = $details->city; # Emeryville
  $loc = $details->loc; # 37.8342,-122.2900
}
else   # invalid data obtained, show error message
{
  print $ipinfo->error_msg . "\n";
}

but without a token the library fails at line 47.
It is possible fix it?

immagine

info or geo should not print to console.

when using Geo::IPinfo the method info return the right detailed object but it unnecessarily print it to console.
I end with plenty of

{
  "ip": "202.3.225.115",
  "city": "Papeete",
  "region": "Îles du Vent",
  "country": "PF",
  "loc": "-17.5373,-149.5665",
  "timezone": "Pacific/Tahiti"
}

on the screen instead of just populating my variables.
is it possible to stop this printing ?

Add paid fields to `valid_fields`

The field routine uses valid_fields to determine what a valid field is, and some of the paid fields aren't included in there, so we should add them to it.

Use versioned cache key

Make sure the cache key contains a number to indicate the version of the cached data. Data changes that change what's expected in cached data require a version change.

Fix 404 when IP input is missing

The library essentially queries https://ipinfo.io//geo when we call the function without an IP input, and this endpoint (with the 2 slashes before geo) gives a 404. Likely we changed this behavior in the API at some point so it broke the Perl SDK which didn't have this problem before.

Just a simple fix of not accidentally adding an extra slash is needed.

Inline all data files

We have several files like eu.json, countries.json, continents.json and so on, which are loaded during initialization / startup of the client.

Instead of loading these as such, which has risks such as the asset not appearing in a production environment properly, and has a performance penalty during init of loading an on-disk file, we should inline the files into a static, in-memory map / dictionary or similar.

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.