Hi guys, I have a location sensitive application where clients enter their zipcodes when signing up. Is there any tool out there, or anyway to confirm that the zipcode entered is indeed a true and valid zipcode and not just 5 random numbers? Thanks and Regards, Bertly -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Fri, Jul 8, 2011 at 12:29 PM, bertly_the_coder <muchira-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi guys, > > I have a location sensitive application where clients enter their > zipcodes when signing up. Is there any tool out there, or anyway to > confirm that the zipcode entered is indeed a true and valid zipcode > and not just 5 random numbers? > > Thanks and Regards, > Bertly > >Bertly, you might want to take a look at Geocoder: http://rubygems.org/gems/geocoder If you provide and invalid zip code, then you should get nil. For example, $ irb ruby-1.9.2-head :001 > require ''geocoder'' => true ruby-1.9.2-head :002 > Geocoder.coordinates("25 Main St, Cooperstown, NY") => [42.700124, -74.922749] ruby-1.9.2-head :003 > Geocoder.coordinates("90230") => [33.9933257, -118.3987842] ruby-1.9.2-head :004 > Geocoder.coordinates("00000") => nil BTW, Ryan Bates also did the following screencast on this gem: http://railscasts.com/episodes/273-geocoder Good luck, -Conrad> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 8 July 2011 20:29, bertly_the_coder <muchira-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi guys, > > I have a location sensitive application where clients enter their > zipcodes when signing up. Is there any tool out there, or anyway to > confirm that the zipcode entered is indeed a true and valid zipcode > and not just 5 random numbers?Postal codes are not always just 5 digits. In the UK they are a combination of letters and digits for example. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Conrad On Jul 8, 3:52 pm, Conrad Taylor <conra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Fri, Jul 8, 2011 at 12:29 PM, bertly_the_coder <much...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi guys, > > > I have a location sensitive application where clients enter their > > zipcodes when signing up. Is there any tool out there, or anyway to > > confirm that the zipcode entered is indeed a true and valid zipcode > > and not just 5 random numbers? > > > Thanks and Regards, > > Bertly > > Bertly, you might want to take a look at Geocoder: > > http://rubygems.org/gems/geocoder > > If you provide and invalid zip code, then you should get nil. For example, > > $ irb > ruby-1.9.2-head :001 > require ''geocoder'' > => true > ruby-1.9.2-head :002 > Geocoder.coordinates("25 Main St, Cooperstown, NY") > => [42.700124, -74.922749] > ruby-1.9.2-head :003 > Geocoder.coordinates("90230") > => [33.9933257, -118.3987842] > ruby-1.9.2-head :004 > Geocoder.coordinates("00000") > => nil > > BTW, Ryan Bates also did the following screencast on this gem: > > http://railscasts.com/episodes/273-geocoder > > Good luck, > > -Conrad > > > > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Fri, Jul 8, 2011 at 12:29 PM, bertly_the_coder <muchira-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi guys, > > I have a location sensitive application where clients enter their > zipcodes when signing up. Is there any tool out there, or anyway to > confirm that the zipcode entered is indeed a true and valid zipcode > and not just 5 random numbers? > > Thanks and Regards, > Bertly > >Here are some more options: http://www.zipcodedownload.com/Products/Family/ZIP5/ Also, the above site has additional options. Good luck, -Conrad> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sent from my iPhone On Jul 8, 2011, at 12:52 PM, Conrad Taylor <conradwt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Fri, Jul 8, 2011 at 12:29 PM, bertly_the_coder <muchira-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Hi guys, > > I have a location sensitive application where clients enter their > zipcodes when signing up. Is there any tool out there, or anyway to > confirm that the zipcode entered is indeed a true and valid zipcode > and not just 5 random numbers? > > Thanks and Regards, > Bertly > > > Bertly, you might want to take a look at Geocoder: > > http://rubygems.org/gems/geocoder > > If you provide and invalid zip code, then you should get nil. For example, > > $ irb > ruby-1.9.2-head :001 > require ''geocoder'' > => true > ruby-1.9.2-head :002 > Geocoder.coordinates("25 Main St, Cooperstown, NY") > => [42.700124, -74.922749] > ruby-1.9.2-head :003 > Geocoder.coordinates("90230") > => [33.9933257, -118.3987842] > ruby-1.9.2-head :004 > Geocoder.coordinates("00000") > => nil > > BTW, Ryan Bates also did the following screencast on this gem: > > http://railscasts.com/episodes/273-geocoder > > Good luck, > > -Conrad >USPS also has an API you can use.> -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I said zipcodes though, Colin. On Jul 8, 4:03 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 8 July 2011 20:29, bertly_the_coder <much...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi guys, > > > I have a location sensitive application where clients enter their > > zipcodes when signing up. Is there any tool out there, or anyway to > > confirm that the zipcode entered is indeed a true and valid zipcode > > and not just 5 random numbers? > > Postal codes are not always just 5 digits. In the UK they are a > combination of letters and digits for example. > > Colin-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jul 8, 2011, at 1:29 PM, bertly_the_coder wrote:> I have a location sensitive application where clients enter their > zipcodes when signing up. Is there any tool out there, or anyway to > confirm that the zipcode entered is indeed a true and valid zipcode > and not just 5 random numbers?That''s hard, because they''re updated fairly frequently according to USPS needs, so a one-time file import would not be very good. Which leaves you looking for a service to subscribe to. -- Scott Ribe scott_ribe-ZCQMRMivIIdUL8GK/JU1Wg@public.gmane.org http://www.elevated-dev.com/ (303) 722-0567 voice -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Fri, Jul 8, 2011 at 12:29 PM, bertly_the_coder <muchira-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi guys, > > I have a location sensitive application where clients enter their > zipcodes when signing up. Is there any tool out there, or anyway to > confirm that the zipcode entered is indeed a true and valid zipcode > and not just 5 random numbers? > > Thanks and Regards, > Bertly > >Bertly, if you''re within the US, the you might be able to use the services used by USPS located here: http://www.usps.com/webtools/ I''m guessing using a service like this that the data will always be up to date. Also, it should gel nicely with Rails. Good luck, -Conrad> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.