Somewhat unrelated, but I've grown to dislike the Skype addon for Firefox because of its phone number recognition. It gets far too many false positives. Even numbers several digits short of being a phone number are often mistaken as one, throwing off the formatting of the page.
I know, but I'm lazy and I'd like to be able to know by looking at a link instead of tapping and holding each number for a few seconds (and then pressing the cancel button if it's a phone number).
Apple could put a little phone icon to the left or right of the auto-generated links. In my usage though phone numbers are very rarely linked (where would they go?), so when I see a linked one on an iOS device I assume it will trigger a phone call.
And I regret not blogging about it on my personal blog and linking that here to generate traffic and potential subscribers there. LOL.
Of course, it may not have actually been a wasted opportunity as the (google.com) URL part of the title probably accounts for a large percentage of clicks.
P.S. I upvoted your comment to generate a little more karma as compensation.
Hehe. Not sure you should do that though (according to the HN guidelines, one should submit the original source) ;)
Thanks for the upvote, that's kind of you!
In retrospect, I shouldn't have "whined" in my previous comment. As the Facebook quote goes ("If you guys were the inventors of Facebook, you'd have invented Facebook"): had I wanted to post this on HN, I would have posted it on HN!
I'll try to post more links in the future (Java or otherwise), and stop trying to anticipate their success according to some pre-conceived notion of what the HN crowd likes: if I think it is interesting, someone else might like it as well ;)
Found this today whilst I was looking for a solution to standardised formatting of phone numbers. I was hoping for a ruby solution, but this is an extremely complete library supporting formatting and validation for 228 countries/regions.
I'm interested in how the completeness is defined, as the standards available are loose at best. I couldn't see by what measure they considered this work 'complete'.
That complaint aside, it's a great effort to see. Now to test it out...
Well... habermann24 (https://github.com/habermann24/libphonenumber-ruby) looks like he's started on a ruby port and he also has his phoney library which doesn't appear to use the same dataset and doesn't work properly for Australia.
I am planning on just using the Java version with JRuby - it will probably be faster than a pure ruby version anyway.
Not the answer you were looking for, but you could run the Java lib with JRuby, or use the JS lib with Ruby/V8 and "The Ruby Racer" (https://github.com/cowboyd/therubyracer)
Well, when you think about the amount of data collection required to reach this level of coverage I don't blame a smallish start-up like Twilio for not having a library.
After all, if you want to test to see if a number is valid, try and call it.
It's a daunting amount to approach, but it rarely takes more than an hour or two per country. I've been doing something similar for my current project, because I want to take phone numbers in national form and show them in both international and national forms.
This stuff is non-trivial. I'll guess that I have spent in excess of 50 hours working on just the UK data in the last couple of months.
The problem is this. Although there are hundreds of websites with UK area code lists, almost all of them are either incorrect, out of date, full of typos, or are generally unreliable. Even lists from "official" sources cannot be relied on with any degree of certainty. The obvious errors are easy to find and correct. It took a long time to find out there were many non-obvious errors and there are likely more errors still to be uncovered.
Awesome! I'm currently working on a project to deal with all sorts of phone numbers in bulk. I've already duplicated some of this in my own way, but I think it might come in handy for the rest.
994 is the correct country code; where are you trying to call from? If you're in the US or Canada, you need to dial the exit code first; for other countries, you might need other additional prefixes.