Find Latitude Longitude using Ip address


Below mentioned way is to get lat long using ip address

It allows 250 requests in a minute

http://ip-api.com

Using Net::HTTP

require 'net/http'

class LatLong
def self.find(remote_ip)
Proc.new{
   url = URI.parse("http://ip-api.com/json/#{remote_ip}")
req = Net::HTTP::Get.new(url.to_s)
res = Net::HTTP.start(url.host, url.port) {|http|
   http.request(req)
}
JSON.parse res.body
}
end
end


Using open-uri

// Open URI way

require 'open-uri'

# Class for writing all the custom geocoding related code
class LatLong
# method for finding the ip address related details
def self.find(remote_ip)
Proc.new{
res = open(url).read
JSON.parse res
}
end
end



Post a Comment

35 comments:

  1. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also
    Transparent stickers

    ReplyDelete
  2. I am certainly making the most of your site. You unquestionably have some extraordinary knowledge and incredible stories.
    embossed stickers

    ReplyDelete
  3. I always appreciate quality content, Thanks to you for sharing such post.
    Ask Questions Get Answers

    ReplyDelete
  4. Hi! Great work. I feel nice to be here reading your authentic work.
    Custom Sticker

    ReplyDelete


  5. 192.168.0.1

    192.168.1.1

    router login
    Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now,

    ReplyDelete
  6. Wow, What an Outstanding post. I found this too much informatics. It is what I was seeking for. I would like to recommend you that please keep sharing such type of info.If possible, Thanks. https://192-168-i-i.com

    ReplyDelete
  7. Fine information, many thanks to the author. It is puzzling to me now, but in general, the usefulness and importance is overwhelming. Very much thanks again and best of luck!
    Custom Boxes
    new birthday wishes

    ReplyDelete

  8. 192.168.1.254

    192.168.l.254

    192.168.1.1

    192.168.o.1

    192.168.l0.1

    192.168.l.l

    192.168.o.1

    is a Private IP address and most powerful universal IP addresses, this is used in the Linksys router.

    ReplyDelete
  9. GET BUSINESS CARD PRO
    AT WHOLESALE PRICES
    FOR YOUR BUSINESS INSTANTLY
    PRINT YOUR IDEAS TO LIFE WITH PREMIUM BUSINESS CARD PRO, POSTCARDS AND MORE.
    Spot uv Business Card

    ReplyDelete
  10. I’ve recently started a blog, the info you provide on this web site has helped me tremendously. Thanks for all of your time & work.
    Printed Labels
    Printed Stickers UK
    Inset Printing

    ReplyDelete
  11. The best explanation about this topic in this part of the universe. Thank you. wholesale kraft boxes

    ReplyDelete
  12. Good but i have problem for responsive Google+ comment on my website Soap boxes

    ReplyDelete
  13. This is also a very good post which I really enjoyed reading. This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog. and Thank you For Sharing. custom packaging boxes printing

    ReplyDelete
  14. Great post - thanks for sharing. I rather enjoy non-iframe content. seems to make everything work a little bit better! custom packaging printing

    ReplyDelete
  15. I must say, i believed this was a pretty fascinating browse when it involves this subject. Liked the material la web design

    ReplyDelete
  16. I’ve been absent for a while, but now I remember why I used to love this website. Thanks , I’ll try and check back more often. How frequently you update your web site? web design agencies los angeles

    ReplyDelete
  17. I am impressed. I don't think I've met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here
    Custom Counter Display Boxes
    Custom Christmas Boxes
    Printed on Demand Boxes UKCustom Soap Boxes
    Cannabis Tinctures Packaging
    Custom Vape Packaging
    E-Cigarette Boxes
    Printed on Demand Boxes UK

    ReplyDelete
  18. Obviously I like your web site, but you have to take a look at the spelling on quite a few of your posts. Several of them are rife with spelling problems and I find it very bothersome to inform you. Nevertheless I will surely come again again! website design company

    ReplyDelete



  19. 192.168.l.254


    192.168.10.1


    192.168.0.1


    192.168.1.1 This IP address is used by the routers like TP-Link, Netgear, D-Link uses it as the default IP address.

    ReplyDelete
  20. Thank you for sharing superb information. Your blog is very cool. I am impressed by your blog and detail that you have on this site. Thank you…
    Custom Printed Boxes
    Custom Boxes with Logo
    Custom CBD Boxes

    ReplyDelete
  21. Routers are the most important devices that are required to get the internet connectivity. There are many brands and router models around the globe. Most people use multiple brand routers, they don't know how to configure them for the perfect usage. Here at https://router-networks.com we have all the manuals for configuring the router login pages.


    ReplyDelete
  22. I like the valuable info you provide in your articles. I will bookmark your blog and check again here frequently. I am quite certain I will learn many new stuffs right here! Good luck for the next!
    factory outlets market of clothing brands in Lahore

    ReplyDelete
  23. Excellent post. I was checking constantly this blog and I am impressed! Very useful info.Thanks for sharing.Keep it up.


    factory outlets market of clothing brands in Lahore

    ReplyDelete
  24. Excellent post. I was checking constantly this blog and I am impressed! Very useful info.Thanks for sharing.Keep it up.


    Create PayPal account in Pakistan legally

    ReplyDelete
  25. This is actually the kind of information I have been trying to find. Thank you for writing this information. Pillow boxes

    ReplyDelete
  26. A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. Soap boxes

    ReplyDelete