Skip to content

Commit

Permalink
Upgrade to v1
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Nov 18, 2016
1 parent c51d807 commit 4b3d390
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cpanfile
Expand Up @@ -7,7 +7,7 @@ requires 'HTTP::Tiny::Mech';
requires 'IO::Socket::SSL';
requires 'JSON';
requires 'MetaCPAN::API::Tiny';
requires 'MetaCPAN::Client', '>= 1.015000';
requires 'MetaCPAN::Client', '>= 1.028003';
requires 'Search::Elasticsearch';
requires 'WWW::Mechanize::Cached';
requires 'WWW::Mechanize::Cached::GZip';
Expand Down
7 changes: 4 additions & 3 deletions lib/MetaCPAN/Util.pm
Expand Up @@ -8,9 +8,10 @@ use Sub::Exporter -setup => { exports => ['es'] };

sub es {
return Search::Elasticsearch->new(
cxn_pool => 'Static::NoPing',
nodes => 'api.metacpan.org',
trace_to => 'Stdout',
cxn_pool => 'Static::NoPing',
nodes => 'https://fastapi.metacpan.org',
send_get_body_as => 'POST',
trace_to => 'Stdout',
);
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/endpoints/author/1-fetch-single-author-curl.sh
@@ -1,3 +1,3 @@
#!/bin/sh

curl http://api.metacpan.org/v0/author/MSTROUT
curl https://fastapi.metacpan.org/v1/author/MSTROUT
4 changes: 2 additions & 2 deletions scripts/endpoints/author/1-fetch-single-author-es.pl
Expand Up @@ -8,12 +8,12 @@

my $es = Search::Elasticsearch->new(
cxn_pool => 'Static::NoPing',
nodes => 'api.metacpan.org',
nodes => 'fastapi.metacpan.org',
trace_to => 'Stdout',
);

my $author = $es->get(
index => 'v0',
index => 'v1',
type => 'author',
id => 'MSTROUT',
);
Expand Down
12 changes: 0 additions & 12 deletions scripts/endpoints/author/1-fetch-single-author-mcpan-api-tiny.pl

This file was deleted.

Expand Up @@ -6,6 +6,6 @@

use WWW::Mechanize::Cached::GZip;
my $mech = WWW::Mechanize::Cached::GZip->new;
$mech->get('http://api.metacpan.org/v0/author/MSTROUT');
$mech->get('https://fastapi.metacpan.org/v1/author/MSTROUT');

say $mech->content;
Expand Up @@ -6,7 +6,7 @@
use Data::Printer;
use MetaCPAN::Client;

my $mcpan = MetaCPAN::Client->new();
my $mcpan = MetaCPAN::Client->new( version => 'v1' );
my $author = $mcpan->author('MSTROUT');

p $author;
Expand Up @@ -7,7 +7,7 @@
use Data::Printer;
use MetaCPAN::Client;

my $mc = MetaCPAN::Client->new;
my $mc = MetaCPAN::Client->new( version => 'v1' );

my $search = $mc->author( { name => 'Olaf *' } );

Expand Down
2 changes: 1 addition & 1 deletion scripts/endpoints/author/1b-scroll-all-authors-es.pl
Expand Up @@ -9,7 +9,7 @@
my $scroller = es()->scroll_helper(
search_type => 'scan',
scroll => '5m',
index => 'v0',
index => 'v1',
type => 'author',
size => 100,
body => {
Expand Down

0 comments on commit 4b3d390

Please sign in to comment.