¥È¡¼¥Æ¥à¥Ý¡¼¤ë

¥È¡¼¥Æ¥à¥Ý¡¼¤ë¤Ï¤¸¤á¤Þ¤·¤¿

¾åµ­¤Î¹­¹ð¤Ï£±¥ö·î°Ê¾å¹¹¿·¤Î¤Ê¤¤¥Ö¥í¥°¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¿·¤·¤¤µ­»ö¤ò½ñ¤¯»ö¤Ç¹­¹ð¤¬¾Ã¤»¤Þ¤¹¡£
--.--.-- --:-- | ¥¹¥Ý¥ó¥µ¡¼¹­¹ð | ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯(-) | ¥³¥á¥ó¥È(-) |

mixi¤Ç³°Éô¥Ö¥í¥°¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Î±¿ÍÑË¡¤ò Plagger¤ò»È¤Ã¤Æ´Êñ²½¤·¤Æ¤ß¤¿¡£

A FreeBSD GIMPer mixi¤È³°Éô¥Ö¥í¥°¤ÎÍͤʱ¿ÍѤò¤¹¤ë¤Ë¤¢¤¿¤Ã¤ÆÌäÂê¤Ë¤Ê¤ë¤Î¤¬¼êºî¶È¤Ç¤ä¤ë¤Î¤¬Èó¾ï¤ËÌÌÅݽ­¤¤¤È¤¤¤¦¤³¤È¡£ ¤½¤³¤Ç¤³¤ì¤¬ÊØÍø¤Ë¤Ê¤ë¤è¤¦¤Ê¥Ä¡¼¥ë¤¬É¬Íפˤʤ롣

¼Â¸½ÊýË¡°Æ¤È¤·¤Æ¤Ï

  • blog¤ÎÅê¹Æ»þ¤Ëhook¤·¤Æmixi¤ÎÅê¹Æ¥¢¥¯¥·¥ç¥ó¤ò¸Æ¤Ó½Ð¤¹¡£
  • ³°Éô¤Î¥½¥Õ¥È¤«¤éblog, mixi¤ÎξÊý¤ÎÅê¹Æ¥¢¥¯¥·¥ç¥ó¤ò¸Æ¤Ó½Ð¤¹¡£
  • blog¤ÎRSS¤ÎÆâÍÆ¤òmixi¤Ëµ­»ö¤´¤È¤Ëpost¤¹¤ë¡£
Åù¤¬¤¢¤ë¡£

¤·¤«¤·¡¢¼«Ê¬¤ÏÌܤÎÁ°¤ËPC¤¬¤Ê¤¤¤È¤­¤Ë¤Ï¥â¥Ö¥í¥°¤Ç¹¹¿·¤¹¤ë¤Î¤Ç¤³¤ì¤ò¹Íθ¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ ¤½¤ì¤ò¹Íθ¤·¤¿¼êË¡¤È¤·¤ÆÅ¬¤·¤Æ¤¤¤ë¤Î¤Ï¾åµ­¤Î°ìÈֺǸå¤Î¡¢RSS·Ðͳ¤Çmixi¤Ëpost¤¹¤ëÊýË¡¤Ç¤¢¤ë¡£ ¤Ê¤¼¤Ê¤é¤Ð¤³¤ÎÊýË¡¤Ê¤é¤ÐüËö¤«¤é¤Îpost¤Ï°ìÅ٤ǺѤफ¤é¤Ç¤¢¤ë¡£

¤È¤¤¤¦¤³¤È¤ÇRSS¤òÄ´Íý¤·¤Æ¤½¤ì¤òmixi¤ËÅê¹Æ¤¹¤ë»ÅÁȤߤò¹Í¤¨¤Æ¤ß¤Æ¡¢¤¿¤·¤«"¤×¤é¤Ã¤¬¡¼"¤È¤«¤¤¤¦¤Î¤¬¡Ä¤È¤Ò¤é¤á¤¤¤¿¤Î¤Ç"plagger"¤Ç¸¡º÷¤·¤Æ¤ß¤¿¤é¤ä¤Ã¤Ñ¤ê¤½¤¦¤¤¤¦¤â¤Î¤À¤Ã¤¿¤è¤¦¤Ê¤Î¤Ç¤½¤ì¤ò»È¤Ã¤Æ¤ß¤ë¤³¤È¤Ë¤·¤¿¡£

¤È¤¤¤¦¤ï¤±¤Ç

¤¢¤¿¤ê¤òÆÉ¤ó¤Ç¤´¤ê¤´¤ê¡¼¤Ã¤È¤ä¤Ã¤Æ¤ß¤¿¡£ ¤½¤â¤½¤âplagger¤ò»È¤¦¤³¤È¼«Âνé¤á¤Æ¤À¤Ã¤¿¤Î¤Ç¿§¡¹»þ´Ö¤¬¤«¤«¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£

FreeBSD¤Îports¤«¤éplagger¤ò¤¤¤ì¤Æ¤ß¤¿¤¬ÄɲäÎplugin¤ÎºîË¡¤È¤«¹Í¤¨¤ë¤Î¤¬¤á¤ó¤É¤¯¤µ¤«¤Ã¤¿¤Î¤Çuser directory¤Ë svn co http://svn.bulknews.net/repos/plagger/trunk/plagger ¤Ç°ú¤ÃÄ¥¤Ã¤Æ¤­¤Æ¤½¤Î²¼¤Ç¤´¤½¤´¤½¤ä¤Ã¤¿¡£

ports://www/p5-WWW-Mixi ( Perl¥â¥¸¥å¡¼¥ë/WWW::Mixi - Walrus, Digit.) ¤¬É¬ÍפʤΤǤ³¤ì¤â¤¤¤ì¤ë¡£

MixiDiary.pm ¤Ï¤³¤ó¤Ê´¶¤¸¤Ë¤·¤¿


package Plagger::Plugin::Publish::MixiDiary;
use strict;
use warnings;
use base qw ( Plagger::Plugin );

use WWW::Mixi;
use Encode;
use Time::HiRes qw(sleep);

sub register {
    my($self, $context) = @_;
    $context->register_hook(
        $self,
        'publish.init'  => \&initialize,
        'publish.entry' => \&post_diary,
    );
}

sub initialize {
    my($self, $context, $args) = @_;

    my $cookie_jar = $self->cookie_jar;
    if (ref($cookie_jar) ne 'HTTP::Cookies') {
        $self->conf->{username} ||= 'email@example.com',
        $self->conf->{password} ||= 'p4ssw0rd',
    }

    $self->{mixi} = WWW::Mixi->new(
        $self->conf->{username},
        $self->conf->{password},
        -log => 0,
    );
    $self->{mixi}->cookie_jar($cookie_jar);

    unless ($self->{mixi}->login) {
        $context->log(error => "Login failed.");
    } else {
        $context->log(info => "Login Successed.");
    }
}

sub post_diary {
    my($self, $context, $args) = @_;

    my $e = $args->{entry};

    my $title = $e->title;
    my $body  = $e->body_text;
    my $linkurl = $e->link;
    my $memo = "-------------------------------\n originally posted 
        on Your Blog\n";
    $body = $body."\n\n".$memo.$linkurl; # $body plus quotation
    my @images;

    if ($e->has_enclosure) {
        for my $enclosure (grep { defined $_->url 
            && $_->is_inline 
            && ($_->url =~ /.*\.jpg$/) } $e->enclosure) {
            push(@images, $enclosure->local_path);
        }
    }

    my %diary = (
        diary_title => encode('euc-jp', $title),
        diary_body  => encode('euc-jp', $body),
        photo1      => shift(@images),
        photo2      => shift(@images),
        photo3      => shift(@images),
    );

    my $sleeping_time = $self->conf->{interval} || 3;
    if ($self->{mixi}->get_add_diary_confirm(%diary)) {
        $context->log(info => "Making diary succeeded.");
    } else {
        $context->log(error => "Making diary failed.");
    }
}

1;
__END__

=hea1 NAME

Plagger::Plugin::Publish::MixiDiary - publish mixi diary

=head1 SYNOPSIS

  - module: Publish::MixiDiary
      config:
            username: email@example.com
            password: p4ssw0rd
            interval: 10

=head1 DESCRIPTION

This plugin posts entry to mixi diary.

=over 4

=item username, password

Your e-mail and password for logging in mixi

=back

=cut

=head1 AUTHOR

Tsuyoshi Maekawa

=head1 SEE ALSO

L<Plagger>, L<WWW::Mixi>, L<http://mixi.jp/>

=cut

config.yaml ¤Î¤Û¤¦¤Ï¤³¤ó¤Ê´¶¤¸¡£


global:
    timezone: Asia/Tokyo
    log:
      level: info

plugins:
  - module: Subscription::Config
    config:
      feed:
        - url: http://www.example.com/?xml

  - module: Filter::Rule
    rule:
        module: Deduped
        path: /home/user/tmp/plagger/cache_rule/feed2mixidiary.tmp
        compare_body: 1

  - module: Filter::Reverse

  - module: Filter::FindEnclosures
  - module: Filter::FetchEnclosure
    config:
        dir: /home/user/tmp/plagger/fetch_images

  - module: Publish::MixiDiary
    config:
        username: email@example.com
        password: p4passw0rd
        interval: 10


Reverse.pm ¤Î¥³¡¼¥É¤Ïnirvash¤ÎÆüµ­ - [sbm] del.icio.us to hatebu¤«¤é

¤¢¤È¡¢¼«Ê¬¤Î¤È¤³¤í¤Ç¤Ïʸ»ú²½¤±¤·¤Ê¤«¤Ã¤¿¤±¤É¡¢Ê¸»ú²½¤±¤¹¤ë¾ì¹ç¤Ï[plagger]feed to mixi recipe - HisasueVox¤¬»²¹Í¤Ë¤Ê¤ë¤À¤í¤¦¡£

¤¢¤È¤Ï¼«Â𻪤ʤɤÇcron¤Ç²ó¤·¤Æ¤ª¤±¤ÐÎɤ¤¤À¤í¤¦¡£

¸½ºß¼«Ê¬¤Ï¤È¤ê¤¢¤¨¤º

#!/bin/sh

while :
do
    ./mixidiary/plagger/plagger -c ./mixidiary/config.yaml
    sleep 3600
done
¤ÎÍͤÊshell script ¤ò½ñ¤¤¤Æ¤³¤ì¤ÇÍͻҤò¸«¤Æ¤¤¤ë¡£

¥­¡¼¥·¥ç¡¼¥È¥«¥Ã¥È: b - Á°¤Î¥Ú¡¼¥¸ n - ¼¡¤Î¥Ú¡¼¥¸

¥Æ¥¹¥È http://blogs.yahoo.co.jp/urashimataorz/

2009.03.26 15:27¡¡URL | ½Ð°©¤¤¶õ´Ö #tHX44QXM¡¡[ ÊÔ½¸ ]













´ÉÍý¼Ô¤Ë¤À¤±É½¼¨

¥È¥é¥Ã¥¯¥Ð¥Ã¥¯URL¢­
http://youcharmanums.blog2.fc2.com/tb.php/478-e0a558a2

[Æüµ­]Twitter¤òmixiÆüµ­¤ËÁ÷¤ê¤¿¤¯¤Æ
°­Àï¶ìÆ®¤·¤Æ¡¢¤ä¤Ã¤È¤³¤µWinndows´Ä¶­¤Ë Perl¡¡5.8.8.817 Plagger¡¡0.7.17 ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¬ºÑ¤ó¤À¡£ ¤½¤·¤Æ¡¢Muibrog - 2007-04-24¤Ë¤¢¤ë 1Æü¤ÎTwitter¤ò¤Þ¤È¤á¤ÆMixiÆüµ­¤Ë¤Ê¤²¤ë¥ì¥·¥Ô¤òƳÆþ¤·¤¿¡£ AssembleEntries.pm¡¢yaml¤ò´Ý¼Ì¤·¤ÇºîÀ®¤·¡¢ MixiDiary.pm¤âA FreeBS

2007.10.05 21:41 | ³èưµ­Ï¿

tdiary¤Èmixi¤ÎÆüµ­¤òƱ´ü¤µ¤»¤ë
û´ü´Ömixi¤ÇÆüµ­½ñ¤¤¤¿¡©¤é¤Ê¤Ë¤²¤Ë­¤¢¤È¤¬ÌÌÇò¤«¤Ã¤¿¤Ê¤¡¤È»×¤¤¡¢tdiary¤Î¹¹¿·ÆâÍÆ¤ò¤½¤Î¤Þ¤Þmixi¤ËÈ¿±Ç¤Ç¤­¤¿¤é¤Ê¤¡¤ÈÄ´¤Ù¤¿¤é¤ä¤Ã¤Ñ¤¢¤ë¤è¤Í »²¹Í¤Ë¤·¤¿¤Î¤ÏPlagger¤ò¤Ä¤«¤Ã¤ÆBlog¤ÈMixi¤ÎÆüµ­¤òƱ´ü¤µ¤»¤ë ÅöÆü¹¹¿·¤¹¤ë»ö¤Ï¾¯¤Ê¤¤¤Î¤Ç¥¿¥¤¥È¥ë¤ËÆüÉÕÆþ¤ì¤¿¤«¤Ã¤¿¤Î¤...

2009.04.21 15:10 | ¤Î¤ó¤À¤¯¤ìÆüµ­

¥­¡¼¥·¥ç¡¼¥È¥«¥Ã¥È: b - Á°¤Î¥Ú¡¼¥¸ n - ¼¡¤Î¥Ú¡¼¥¸