API-Medium
view release on metacpan or search on metacpan
example/hello_medium.pl view on Meta::CPAN
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use API::Medium;
my $token = $ARGV[0];
print "Usage: $0 your_access_token\n" && exit unless $token;
my $m = API::Medium->new( { access_token => $token, } );
my $user = $m->get_current_user;
my $post_url = $m->create_post(
$user->{id},
{ "title" => "Hello, Medium",
"contentFormat" => "html",
"content" => "<h1>Hello, Medium</h1><p>It works...</p><p>s/ð/ð²/g</p>",
"tags" => [ "Perl", "CPAN", "API" ],
"publishStatus" => "draft",
#"canonicalUrl": "http://example.com/it-works.html",
}
);
print "Your post is ready: $post_url\n";
( run in 0.852 second using v1.01-cache-2.11-cpan-d8267643d1d )