Coder Social home page Coder Social logo

yourls-ip-viewer's Introduction

yourls-ip-viewer's People

Contributors

faab007nl avatar

Stargazers

 avatar  avatar

Watchers

 avatar

yourls-ip-viewer's Issues

Added functionality to the plugin (is this the right place for this?)

I've been enjoying using this plugin but got frustrated with all the copy/paste to a whois tool when trying to get more info on who has clicked my links so I thought I'd try to add a hyperlink to the table listing IP addresses despite the fact that I don't really know how to code. After much trial and error (not to mention googling) I'm very excited that it works!

I think that others would find this useful and I'd like to share it besides making my first ever contribution to a GitHub project. Details are below but is there a better way to include this new functionality to the master?

What I did:
I added another column/header item to the end of the display table code so
<table> <tr> <th>IP</th> <th>Shorturl</th> <th>Referrer</th> <th>User Agent</th> <th>IP Address</th> <th>Country</th> <th>Date &amp; Time</th> </tr> ";
became
table> <tr> <th>IP</th> <th>Shorturl</th> <th>Referrer</th> <th>User Agent</th> <th>IP Address</th> <th>Country</th> <th>Date &amp; Time</th> <th>WhoIs</th> </tr> ";
That was the easy part.

Then, after lots of trying I got the next part to work. At the bottom of the table code, after
echo "<td><input value='".$row['click_time']."' readonly/></td>";
but before
echo "</tr>"; } echo " </table>
I added
echo "<td><a href=https://who.is/whois-ip/ip-address/{$row['ip_address']} target=_blank>" . $row['ip_address']."</a></td>";

I tried a few different whois tools, specifically https://iplocation.io/ip-whois-lookup and https://whois.domaintools.com/, but I found that https://who.is/ seems to work best without captchas, limits, etc. though it does take a bit long for each page to load. You can easily use the IP lookup tool of your choice, as long as it's accessed by concatenating the IP address in question within the URL by simply replacing https://who.is/whois-ip/ip-address/ with the URL (minus the IP address slug, that's handled automatically by the {$row['ip_address']} piece) of the lookup tool you prefer.

Did I do good? Is this something that makes sense to include in the main code? If so, how to do so?

I suppose there is one issue that remains, the width of the added column for WhoIs makes the User Agent column data a bit too small. I'm not sure how to fix that but I suppose one option would be to remove the IP Address column now that this data is repeated in the new column but that seems less than ideal to me.

Thanks in advance for your input!

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.