Update from Mashape to RapidAPI#1450
Conversation
The Mashape API proxy URL has been deprecated and replaced with the RapidAPI proxy URL. These changes will update the code to work with the new URL
The Mashape URL has recently been deprecated so for reliable use of Telize you will need to use the RapidAPI URL instead.
| assert qurl.include?("mashape-key") | ||
| assert !key.include?("mashape-key") | ||
| assert qurl.include?("rapidapi-key") | ||
| assert !key.include?("rapidapi-key") |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
| key = lookup.send(:cache_key, query) | ||
| assert qurl.include?("mashape-key") | ||
| assert !key.include?("mashape-key") | ||
| assert qurl.include?("rapidapi-key") |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
| lookup = Geocoder::Lookup::Telize.new | ||
| query = Geocoder::Query.new("74.200.247.59") | ||
| assert_match %r{^https://telize-v1\.p\.mashape\.com}, lookup.query_url(query) | ||
| assert_match %r{^https://telize-v1\.p\.rapidapi\.com}, lookup.query_url(query) |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [82/80]
| lookup = Geocoder::Lookup::Telize.new | ||
| query = Geocoder::Query.new("74.200.247.59") | ||
| assert_match %r{/location/74\.200\.247\.59\?mashape-key=api_key}, lookup.query_url(query) | ||
| assert_match %r{/location/74\.200\.247\.59\?rapidapi-key=api_key}, lookup.query_url(query) |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [94/80]
| lookup = Geocoder::Lookup::Telize.new | ||
| query = Geocoder::Query.new("74.200.247.59") | ||
| assert_match %r{^https://telize-v1\.p\.mashape\.com/location/74\.200\.247\.59}, lookup.query_url(query) | ||
| assert_match %r{^https://telize-v1\.p\.rapidapi\.com/location/74\.200\.247\.59}, lookup.query_url(query) |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [108/80]
| Geocoder.configure(:api_key => "MY_KEY") | ||
| g = Geocoder::Lookup::Telize.new | ||
| assert_match "mashape-key=MY_KEY", g.query_url(Geocoder::Query.new("232.65.123.94")) | ||
| assert_match "rapidapi-key=MY_KEY", g.query_url(Geocoder::Query.new("232.65.123.94")) |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [89/80]
| "#{protocol}://#{configuration[:host]}/location/#{query.sanitized_text}" | ||
| else | ||
| "#{protocol}://telize-v1.p.mashape.com/location/#{query.sanitized_text}?mashape-key=#{api_key}" | ||
| "#{protocol}://telize-v1.p.rapidapi.com/location/#{query.sanitized_text}?rapidapi-key=#{api_key}" |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [105/80]
|
To add some more detail this change is required to fix the hosted Telize lookup service which is currently broken for all versions of this gem. We're currently having to remediate this via a monkey patch in our initializer: |
|
Thanks for this (and sorry for the Hound auto-comments--I've yet to configure it). The code looks good and I'd like to get this merged. The only obstacle is getting an API key so I can test it. I tried the contact form on RapidAPI.com but it wouldn't submit ("Submission failed, please try again later."). Any thoughts on how I might run a few test queries from my local machine? Is there someone I can contact directly? |
|
I've sent you one to use via the contact form on your website. |
|
If you have any issues with the key sent to you by Tim, just shoot an email to support@rapidapi.com and they can help you there. |
|
The key worked great. Thanks! |
The Mashape API proxy has been deprecated and needs to be replaced with RapidAPI proxy URL to work reliably.