Skip to content

Commit b723d0f

Browse files
authored
Update from Mashape to RapidAPI (#1450)
Switch from Mashape URL to RapidAPI The Mashape API proxy URL has been deprecated and replaced with the RapidAPI proxy URL.
1 parent ef1afc5 commit b723d0f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README_API_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ IP Address Lookups
421421
* **Region**: world
422422
* **SSL support**: yes
423423
* **Languages**: English
424-
* **Documentation**: https://market.mashape.com/fcambus/telize
424+
* **Documentation**: https://rapidapi.com/fcambus/api/telize
425425
* **Terms of Service**: ?
426426
* **Limitations**: ?
427427
* **Notes**: To use Telize set `Geocoder.configure(ip_lookup: :telize, api_key: "your_api_key")`. Or configure your self-hosted telize with the `host` option: `Geocoder.configure(ip_lookup: :telize, telize: {host: "localhost"})`.

lib/geocoder/lookups/telize.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def query_url(query)
1616
if configuration[:host]
1717
"#{protocol}://#{configuration[:host]}/location/#{query.sanitized_text}"
1818
else
19-
"#{protocol}://telize-v1.p.mashape.com/location/#{query.sanitized_text}?mashape-key=#{api_key}"
19+
"#{protocol}://telize-v1.p.rapidapi.com/location/#{query.sanitized_text}?rapidapi-key=#{api_key}"
2020
end
2121
end
2222

test/unit/lookup_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def test_geocoder_ca_showpostal
147147
def test_telize_api_key
148148
Geocoder.configure(:api_key => "MY_KEY")
149149
g = Geocoder::Lookup::Telize.new
150-
assert_match "mashape-key=MY_KEY", g.query_url(Geocoder::Query.new("232.65.123.94"))
150+
assert_match "rapidapi-key=MY_KEY", g.query_url(Geocoder::Query.new("232.65.123.94"))
151151
end
152152

153153
def test_ipinfo_io_api_key

test/unit/lookups/telize_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ def setup
1010
def test_query_url
1111
lookup = Geocoder::Lookup::Telize.new
1212
query = Geocoder::Query.new("74.200.247.59")
13-
assert_match %r{^https://telize-v1\.p\.mashape\.com/location/74\.200\.247\.59}, lookup.query_url(query)
13+
assert_match %r{^https://telize-v1\.p\.rapidapi\.com/location/74\.200\.247\.59}, lookup.query_url(query)
1414
end
1515

1616
def test_includes_api_key_when_set
1717
Geocoder.configure(api_key: "api_key")
1818
lookup = Geocoder::Lookup::Telize.new
1919
query = Geocoder::Query.new("74.200.247.59")
20-
assert_match %r{/location/74\.200\.247\.59\?mashape-key=api_key}, lookup.query_url(query)
20+
assert_match %r{/location/74\.200\.247\.59\?rapidapi-key=api_key}, lookup.query_url(query)
2121
end
2222

2323
def test_uses_custom_host_when_set
@@ -38,7 +38,7 @@ def test_requires_https_when_not_custom_host
3838
Geocoder.configure(use_https: false)
3939
lookup = Geocoder::Lookup::Telize.new
4040
query = Geocoder::Query.new("74.200.247.59")
41-
assert_match %r{^https://telize-v1\.p\.mashape\.com}, lookup.query_url(query)
41+
assert_match %r{^https://telize-v1\.p\.rapidapi\.com}, lookup.query_url(query)
4242
end
4343

4444
def test_result_on_ip_address_search
@@ -83,7 +83,7 @@ def test_cache_key_strips_off_query_string
8383
query = Geocoder::Query.new("8.8.8.8")
8484
qurl = lookup.send(:query_url, query)
8585
key = lookup.send(:cache_key, query)
86-
assert qurl.include?("mashape-key")
87-
assert !key.include?("mashape-key")
86+
assert qurl.include?("rapidapi-key")
87+
assert !key.include?("rapidapi-key")
8888
end
8989
end

0 commit comments

Comments
 (0)