Comments (5)
I wonder if it would just be for convenience, I guess it would need to align with the goals of this functionality.
An example use case I have: At my company we monitor AWS ALB logs, and we have reports generated daily about where traffic came from and this uses ipinfo php library to get region/city etc, and we build dashboards on that.
With the introduction of maps I have now added this to our report generation script:
$ipfilename = self::SAVE_PATH .'/ip_list';
file_put_contents($ipfilename, implode("\n", $ips));
// generate map from ipinfo
$response = shell_exec('cat '. $ipfilename .' | curl -XPOST --data-binary @- "ipinfo.io/map?cli=1"');
$response = json_decode(trim($response), true);
$entity->setMapLink($response['reportUrl']);
So I'm basically just doing a shell_exec
to run the example your page says, which works perfectly it's all fine and dandy, at the time I just thought "be handy if I could do $ipinfo->generateMapLink($ips)
Just thought i'd bring up to discuss, as ipinfo is so simple and convenient to use anyway!
from php.
I love that use case, thanks for sharing!
Will get back to you fairly soon about this; hoping we can add it :)
from php.
Alright got the
from php.
Hey @viion , really glad you like the new feature!
From my side, I don't see much value of putting this into the PHP SDK (or any SDK). The output is only going to be some JSON with a link like this:
$ cat ips.txt | curl -XPOST --data-binary @- "ipinfo.io/map?cli=1"
{
"status": "Report Generated",
"reportUrl": "https://ipinfo.io/map/7e55cd2d-a6d9-4724-bb6e-e0c8ac7daf6e"
}
If the intention is to input IPs to an SDK function and then use that link to be displayed somewhere in your app, then that would make sense. But I can't see any other use case. What do you think?
@coderholic any idea if this is worth putting into SDKs?
from php.
Available in v2.2.0.
Example from test cases:
$h = new IPinfo();
$url = $h->getMapUrl(file("tests/map-ips.txt"));
echo "got URL ".$url;
from php.
Related Issues (20)
- Add optional IP selection handler HOT 1
- guzzlehttp/guzzle v7.2 HOT 3
- Please update Composer package HOT 7
- r -v
- PHP 8 Support HOT 2
- Features of extracting json Not working HOT 5
- Make caching more easily optional HOT 4
- Support for IP summarization
- Use versioned cache key
- Add documentation for batch ops function
- Token Referrer restriction with PHP Lib HOT 2
- Step by step install not working HOT 4
- Implement Stringable interface
- More info on why response object can be null when calling IPinfo::getDetails() HOT 12
- Hopper
- Retrieving your public IPv6 address
- The php api does not work on the server but it does on the localhost HOT 1
- Make it possible to use sabre/cache version 2 HOT 4
- Just a detail (php8.2): Creation of dynamic property ipinfo\ipinfo\IPinfo::$settings is deprecated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php.