placefinder 0.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Adolfo Builes
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,35 @@
1
+ placefinder
2
+ ===========
3
+ Yahoo! PlaceFinder is a geocoding webservice that converts street addresses and place names into geographic coordinates.
4
+
5
+
6
+ Use Yahoo! PlaceFinder within your ruby apps using this gem.
7
+
8
+ Synopsis
9
+ ========
10
+
11
+ Install from RubyGems
12
+ gem install placefinder
13
+
14
+ Require it in your files:
15
+
16
+ require 'placefinder'
17
+
18
+ placefinder = Placefinder::Base.new(:api_key => your_api_key)
19
+ params = {:q => "Central Park, NY, US"}
20
+ placefinder.get(params)
21
+
22
+ You are encourage to check the documentation to see the params of the API:
23
+ http://developer.yahoo.com/geo/placefinder/guide/requests.html
24
+
25
+ Super easy! isn't ?
26
+
27
+ NOTE: The api_key is not a required field, you can start hitting their api without it.
28
+
29
+ Author
30
+ ======
31
+
32
+ Adolfo Builes, builes.adolfo@gmail.com
33
+
34
+ Copyright (c) 2011
35
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'pamela'
2
+
3
+ Pamela.load :spec, :console
4
+
5
+ desc 'Default: run specs.'
6
+ task :default => 'spec'
@@ -0,0 +1,20 @@
1
+ require 'rubygems'
2
+ require 'httparty'
3
+
4
+ module Placefinder
5
+ class Base
6
+ include HTTParty
7
+ base_uri 'http://where.yahooapis.com/geocode'
8
+
9
+ def initialize(params = {})
10
+ @api_key = params[:api_key]
11
+ end
12
+
13
+ def get(params = {})
14
+ params.merge!({:appid => @api_key}) if @apy_key
15
+ response = self.class.get('', :query => params)
16
+ response.parsed_response
17
+ end
18
+ end
19
+
20
+ end
@@ -0,0 +1,3 @@
1
+ module Placefinder
2
+ VERSION = "0.1"
3
+ end
@@ -0,0 +1,2 @@
1
+ require 'placefinder/base'
2
+ require 'placefinder/version'
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: placefinder
3
+ version: !ruby/object:Gem::Version
4
+ hash: 9
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ version: "0.1"
10
+ platform: ruby
11
+ authors:
12
+ - Adolfo Builes
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-02-14 00:00:00 -05:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rspec
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :development
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: pamela
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
46
+ type: :development
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: httparty
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 5
57
+ segments:
58
+ - 0
59
+ - 7
60
+ - 3
61
+ version: 0.7.3
62
+ type: :runtime
63
+ version_requirements: *id003
64
+ description: The simplest ruby wrapper for placefinder's API.
65
+ email: builes.adolfo@googlemail.com
66
+ executables: []
67
+
68
+ extensions: []
69
+
70
+ extra_rdoc_files: []
71
+
72
+ files:
73
+ - README.markdown
74
+ - Rakefile
75
+ - LICENSE
76
+ - lib/placefinder/base.rb
77
+ - lib/placefinder/version.rb
78
+ - lib/placefinder.rb
79
+ has_rdoc: true
80
+ homepage: http://github.com/abuiles/placefinder
81
+ licenses: []
82
+
83
+ post_install_message:
84
+ rdoc_options: []
85
+
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ hash: 3
94
+ segments:
95
+ - 0
96
+ version: "0"
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ hash: 3
103
+ segments:
104
+ - 0
105
+ version: "0"
106
+ requirements: []
107
+
108
+ rubyforge_project:
109
+ rubygems_version: 1.4.2
110
+ signing_key:
111
+ specification_version: 3
112
+ summary: "See example: https://github.com/abuiles/placefinder/blob/master/README.markdown"
113
+ test_files: []
114
+