Grans TSUCHINOKO

PlaggerのPublish::MT改造してカテゴリ反映つダメ人間オンライン

Publish::MTを改変
カテゴリ指定で分けたかったのでデフォルトのPublish::MTを少し改変。

sub post_to_mt {
my $self = shift;
my %args = @_;
my $mt = $self->mt;

# FIXME: Can I use XML::RPC::Lite without hack?
Encode::_utf8_off($args{title});
Encode::_utf8_off($args{body});

my $id = $mt->newPost({
title => $self->conf->{title} || $args{title} || ”,
description => $args{body} || ”,
}) or die $mt->errstr;
+ if ($self->conf->{category}) {
+ $mt->setPostCategories($id, $self->conf->{category});
+ }
$mt->publishPost($id);
$id;
}

以前用意していたのをすっかり忘れて未分類投稿になってた。修正。

Permalink | Leave a comment  »

Responses are currently closed, but you can trackback from your own site.

Comments are closed.

v class="span-24">
Powered by WordPress | Designed by: video games | Thanks to Trucks and SUV