From a850166485939ac701b7b177c6f47ab8a41c1980 Mon Sep 17 00:00:00 2001 From: Zach Thompson Date: Fri, 4 Dec 2015 12:19:22 -0700 Subject: [PATCH] Try verbatim alt_to keys again so we don't have to support this CaMeLcAsE translation stuff any longer --- lib/DDG/Spice/Astrobin/Apod.pm | 2 +- lib/DDG/Spice/Flights/Route.pm | 2 +- lib/DDG/Spice/Movie.pm | 2 +- lib/DDG/Spice/SoundCloud.pm | 2 +- t/Astrobin.t | 2 ++ t/Flights.t | 2 ++ t/Movie.t | 2 ++ t/Pokemon.t | 2 ++ t/SoundCloud.t | 2 ++ t/Xkcd.t | 2 ++ 10 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/DDG/Spice/Astrobin/Apod.pm b/lib/DDG/Spice/Astrobin/Apod.pm index 8b4524daab..5f05061e9f 100755 --- a/lib/DDG/Spice/Astrobin/Apod.pm +++ b/lib/DDG/Spice/Astrobin/Apod.pm @@ -22,7 +22,7 @@ spice proxy_cache_valid => "200 60m"; spice wrap_jsonp_callback => 1; spice alt_to => { - fetchid => { + fetch_id => { to => 'http://www.astrobin.com/api/v1/image/$1/?api_key={{ENV{DDG_SPICE_ASTROBIN_APIKEY}}}&api_secret={{ENV{DDG_SPICE_ASTROBIN_APISECRET}}}&format=json', wrap_jsonp_callback => 1 } diff --git a/lib/DDG/Spice/Flights/Route.pm b/lib/DDG/Spice/Flights/Route.pm index 7339acb692..fae37c08e1 100644 --- a/lib/DDG/Spice/Flights/Route.pm +++ b/lib/DDG/Spice/Flights/Route.pm @@ -22,7 +22,7 @@ spice from => '(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)'; spice to => 'https://api.flightstats.com/flex/flightstatus/rest/v2/jsonp/route/status/$4/$5/arr/$6/$7/$8?hourOfDay=$9&utc=true&appId={{ENV{DDG_SPICE_FLIGHTS_API_ID}}}&appKey={{ENV{DDG_SPICE_FLIGHTS_APIKEY}}}&callback={{callback}}'; spice alt_to => { - RouteHelper => { + route_helper => { proxy_cache_valid => '200 304 5m', to => 'https://api.flightstats.com/flex/flightstatus/rest/v2/jsonp/route/status/$1/$2/$3/$4/$5/$6/?hourOfDay=$7&utc=true&appId={{ENV{DDG_SPICE_FLIGHTS_API_ID}}}&appKey={{ENV{DDG_SPICE_FLIGHTS_APIKEY}}}&callback={{callback}}', from => '(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)' diff --git a/lib/DDG/Spice/Movie.pm b/lib/DDG/Spice/Movie.pm index 37b4b13c5c..92d9cef71b 100644 --- a/lib/DDG/Spice/Movie.pm +++ b/lib/DDG/Spice/Movie.pm @@ -19,7 +19,7 @@ spice proxy_cache_valid => "200 7d"; spice to => 'http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey={{ENV{DDG_SPICE_ROTTEN_APIKEY}}}&q=$1&page_limit=50&page=1&callback={{callback}}'; spice alt_to => { - MovieImage => { + movie_image => { to => 'https://api.themoviedb.org/3/find/$1?api_key={{ENV{DDG_SPICE_MOVIEDB_APIKEY}}}&external_source=imdb_id', # Uses $loc so needs to not cache back end. is_cached => 0, diff --git a/lib/DDG/Spice/SoundCloud.pm b/lib/DDG/Spice/SoundCloud.pm index d68256cc53..1cfa24b815 100644 --- a/lib/DDG/Spice/SoundCloud.pm +++ b/lib/DDG/Spice/SoundCloud.pm @@ -19,7 +19,7 @@ attribution web => ['http://jordanscales.com', 'Jordan Scales'], spice call_type => 'self'; spice alt_to => { - SoundCloudResult => { + sound_cloud_result => { to => 'http://api.soundcloud.com/tracks.json?client_id={{ENV{DDG_SPICE_SOUNDCLOUD_APIKEY}}}&q=$1&limit=35&filter=streamable' } }; diff --git a/t/Astrobin.t b/t/Astrobin.t index da60f1a6f1..0fea9f72a8 100644 --- a/t/Astrobin.t +++ b/t/Astrobin.t @@ -24,5 +24,7 @@ ddg_spice_test( ), ); +alt_to_test('DDG::Spice::Astrobin::Apod', ['fetch_id']); + done_testing; diff --git a/t/Flights.t b/t/Flights.t index 10b8922e04..ed24478eb9 100644 --- a/t/Flights.t +++ b/t/Flights.t @@ -123,4 +123,6 @@ ddg_spice_test( 'Boston Paris' => undef, ); +alt_to_test('DDG::Spice::Flights::Route', ['route_helper']); + done_testing; diff --git a/t/Movie.t b/t/Movie.t index ab71184005..14eef4eb20 100644 --- a/t/Movie.t +++ b/t/Movie.t @@ -27,5 +27,7 @@ ddg_spice_test( ), ); +alt_to_test('DDG::Spice::Movie', ['movie_image']); + done_testing; diff --git a/t/Pokemon.t b/t/Pokemon.t index c9a665076b..2b63243be9 100644 --- a/t/Pokemon.t +++ b/t/Pokemon.t @@ -29,5 +29,7 @@ ddg_spice_test( 'how to catch every pokemon', => undef ); +alt_to_test('DDG::Spice::Pokemon::Data', ['description']); + done_testing; diff --git a/t/SoundCloud.t b/t/SoundCloud.t index bab6f6bd1d..56d42f6b8e 100644 --- a/t/SoundCloud.t +++ b/t/SoundCloud.t @@ -24,4 +24,6 @@ ddg_spice_test( ), ); +alt_to_test('DDG::Spice::SoundCloud', ['sound_cloud_result']); + done_testing; diff --git a/t/Xkcd.t b/t/Xkcd.t index 788f16dd79..c7d2325609 100644 --- a/t/Xkcd.t +++ b/t/Xkcd.t @@ -37,6 +37,8 @@ ddg_spice_test( ), ); +alt_to_test('DDG::Spice::Xkcd::Display', ['latest']); + # This function call is expected by Test::More. It makes sure the program # doesn't exit before all the tests have been run. done_testing;