Catalyst Advent Calendar のソースを読んでたら中身は Pod ビュワーだということがわかりました。
ということで、何か作ってみたくなったので、Pod ビュワーを作ってみました。
Pod だけじゃつまんないので、はてな記法にも対応してみました。
拡張子でパーサを決定しています。
表示例:
ソースコード:
- Trac での閲覧
- svn checkout http://svn.woremacx.com/public/Poddr
Catalyst Advent Calendar のソースを読んでたら中身は Pod ビュワーだということがわかりました。
ということで、何か作ってみたくなったので、Pod ビュワーを作ってみました。
Pod だけじゃつまんないので、はてな記法にも対応してみました。
拡張子でパーサを決定しています。
表示例:
ソースコード:
Plagger のプラグインリスト に関して、
と、いろいろな反応をいただいたので、そのようにしてみました。
自動生成に関しては、夜中に 1 回 cron 更新という感じにします。
以下のリンクよりどうぞ。
現在、Plagger のプラグインのリストは自動生成しています。
Plagger Plugin list for trunk よりご覧下さい。
2006年5月25日の内容を、以下に履歴として残します。(2006年7月2日)
Plagger の各プラグインを、使っているフェーズ別に並べてみました。
リストの作成にあたっては、このスクリプト(chkhook.pl)を使用しました。
use base していたりして、自分で register_hook をしてないものは含んでいません。
- CustomFeed::AmazonAssociateReportJP
- CustomFeed::Debug
- CustomFeed::FlickrSearch
- CustomFeed::Frepa
- CustomFeed::Mixi
- CustomFeed::POP3
- CustomFeed::SVNLog
- CustomFeed::Yahoo360JP
- CustomFeed::YouTube
- CustomFeed::iTunesRecentPlay
- Subscription::2chThreadList
- Subscription::Bloglines
- Subscription::Config
- Subscription::DBI
- Subscription::HatenaGroup
- Subscription::HatenaRSS
- Subscription::LivedoorReader
- Subscription::OPML
- Subscription::Odeo
- Subscription::PingServer
- Subscription::PlanetINI
- Subscription::XPath
- Aggregator::Simple
- Aggregator::Xango
- CustomFeed::BloglinesCitations
- CustomFeed::GoogleNews
- CustomFeed::Mailman
- CustomFeed::Simple
- Filter::EntryFullText
- Filter::RSSLiberalDateTime
- Filter::RSSTimeZoneString
- Filter::AtomLinkRelated
- Filter::FeedBurnerPermalink
- Aggregator::Xango
- Filter::2chNewsokuTitle
- Filter::2chRSSContent
- Filter::Base
- Filter::BloglinesContentNormalize
- Filter::BreakEntriesToFeeds
- Filter::BulkfeedsTerms
- Filter::Delicious
- Filter::DeliciousFeedTags
- Filter::Emoticon
- Filter::EntryFullText
- Filter::FeedBurnerPermalink
- Filter::FeedFlareStripper
- Filter::FetchEnclosure
- Filter::FindEnclosures
- Filter::FloatingDateTime
- Filter::HEADEnclosureMetadata
- Filter::HatenaBookmarkTag
- Filter::HatenaDiaryKeywordLink
- Filter::HatenaDiaryKeywordUnlink
- Filter::HatenaFormat
- Filter::HatenaKeywordTag
- Filter::ImageInfo
- Filter::Markdown
- Filter::POPFile
- Filter::Pipe
- Filter::ResolveRelativeLink
- Filter::RewriteEnclosureURL
- Filter::SpamAssassin
- Filter::StripRSSAd
- Filter::TruePermalink
- Filter::BlogPet
- Filter::HatenaBookmarkUsersCount
- Filter::ImageInfo
- Filter::TagsToTitle
- Filter::Thumbnail
- Filter::tDiaryComment
- Filter::BreakEntriesToFeeds
- Filter::POPFile
- Filter::URLBL
- Filter::CompositeFeed
- Filter::Rule
- Filter::CompositeFeed
- Filter::Rule
- Filter::CompositeFeed
- Notify::Campfire
- Notify::Growl
- Publish::Delicious
- Publish::Gmail
- Publish::HatenaBookmark
- Publish::IMAP
- Publish::Maildir
- Publish::Delicious
- Publish::HatenaBookmark
- Publish::IMAP
- Publish::Maildir
- Widget::BloglinesSubscription
- Widget::BulkfeedsSpamReport
- Widget::Delicious
- Widget::HatenaBookmark
- Widget::HatenaBookmarkUsersCount
- Notify::Eject
- Notify::IRC
- Notify::MSAgent
- Notify::SSTP
- Notify::Tiarra
- Notify::UpdatePing
- Publish::2chdat
- Publish::CHTML
- Publish::CSV
- Publish::Debug
- Publish::Feed
- Publish::Gmail
- Publish::JavaScript
- Publish::MT
- Publish::MTWidget
- Publish::OPML
- Publish::OutlineText
- Publish::PDF
- Publish::PSP
- Publish::PalmDoc
- Publish::Pipe
- Publish::Planet
- Publish::Speech
- Publish::Takahashi
- Search::Namazu
- Search::Rast
- Notify::Campfire
- Notify::Growl
- Publish::Playlog
- Search::Estraier
- Search::Spotlight
- Notify::Eject
- Publish::2chdat
- Publish::CHTML
- Publish::IMAP
- Publish::MTWidget
- Publish::Maildir
- Publish::OPML
- Publish::OutlineText
- Publish::PSP
- Publish::PalmDoc
- Publish::Speech
- Publish::Takahashi
- Search::Namazu
- Search::Rast
Plagger のフェーズが気になったので、調べてみました。
- plugin.init
- subscription.load
- (feed = subscription->feeds)
- feed->aggregator OR
- customfeed.handle
(↓Aggregator::* の場合↓)
- aggregator.filter.feed
- (entry = remote->entries)
- aggregator.entry.fixup
- aggregator.finalize
(05/25 02:20 aggregator まわりを修正)
- (feed = update->feeds)
- (entry = feed->entries)
- update.entry.fixup
- update.feed.fixup
- update.fixup
- smartfeed.init
- (feed = update->feeds)
- (entry = feed->entries)
- smartfeed.entry
- smartfeed.feed
- smartfeed.finalize
- publish.init
- (feed = update->feeds)
- (entry = feed->entries)
- publish.entry.fixup
- publish.feed
- (entry = feed->entries)
- publish.entry
- publish.finalize
この記事は、2006/05/23現在のものです。
現行の認証機構のプラグインとは異なりますので、ご利用の際はご注意ください。
pod 読んで、なんとなくわかったつもりになっています。
そこら辺の翻訳サービスの力を借りながら途中まで pod を訳してました。けど、表現力が乏しく、自分でも理解不能な訳ができあがったりしたので、訳するのはやめて、途中からメモだけにしました。
あとで Catalyst::Plugin::Authorization::ACL と Catalyst::Plugin::Authorization::Roles の pod も読む~。
- Catalyst::Plugin::Authentication モジュール
- Authentication と Authorization の両方のベース
- Authentication: 認証 ユーザが誰であるかをチェック
- Authorization: 権限付与 ユーザに権限を与える
- Catalyst で認証するには、以下のものが必要
- Authentication
- Store (ユーザ情報ストレージ) が 1 つ以上
- Credential (ユーザを検証) が 1 つ以上
- Authentication(認証)/Authorization(権限付与) プロセス
- 必要性
- ユーザ固有の情報のやりとり
- アプリ内でのアクセス制御
- 第 1 段階
- フォーム等でユーザ情報を入力してもらう
- 第 2 段階 (Credential verification)
- ユーザ名とパスワード等で、ユーザが本人であるか検証
- 第 3 段階
- ユーザが本人であることを確認 (authenticated) したら
- authorization: ユーザがアプリの中でどんな権限があるか設定
例: 通常ユーザと root とか。
- 関連プラグイン
- ユーザ情報保存用バックエンド
- Catalyst::Plugin::Authentication::Store::Minimal
- Catalyst::Plugin::Authentication::Store::Htpasswd
- Catalyst::Plugin::Authentication::Store::DBIC
- ユーザ検証
- Catalyst::Plugin::Authentication::Credential::Password
- Catalyst::Plugin::Authentication::Credential::HTTP
- Catalyst::Plugin::Authentication::Credential::TypeKey
- Catalyst::Plugin::Authentication::Credential::Hatena
- 権限付与
- Catalyst::Plugin::Authorization::ACL
- Catalyst::Plugin::Authorization::Roles
- その他
- Catalyst::Plugin::Session
(認証データをセッション情報として保存できる)
- Catalyst::Plugin::Session::PerUser
似たようなデザインでダイアログが出てたら、何も考えずにパスワードを入れてしまいそうで怖い。
20:19 <drry> woremacx.repo を勝手に [worepo] に改名して自己満。
23:34 >woremacx< worepo!worepo!worepo!
23:36 <drry> このネタ差し上げますんで、正式採用決定ですよね。
23:38 >woremacx< うは。
(snip)
23:42 >woremacx< http://pub.woremacx.com/...
23:42 >woremacx< ネタいただきますた。
23:43 >woremacx< fc6 とかつけずに worepo にしちゃう?(やりすぎ)
23:43 <drry> ウッwwwワァァァwwwwww
(snip)
worepo は、rawhide (fedora development) 向けのレポジトリです。
人気の Catalyst や Plagger をサクっとインストールできるのが特徴です。
詳しくは、Plagger の fedora-develpment i386 用 rpm をご覧下さい。
Flickr の paginate が好きなので、インスパイアしてみるのです。
Data::Page::Navigation の書き方をまねてみました。
使うには、適当な場所で use しておきます。
package Data::Page::Flickr;
use strict;
use warnings;
use Data::Page;
our $VERSION='0.01';
package Data::Page;
sub pages_in_flickr {
my $self = shift;
my $last = $self->last_page;
return ($self->first_page..$last) unless $last > 11;
my $current = $self->current_page;
my @ret;
if ($current <= 4) {
push(@ret, 1 .. 7);
push(@ret, 0);
push(@ret, $last-1, $last);
} elsif (($last >= 14 && $current <= 8)
|| ($last < 14 && $current <= 6)) {
push(@ret, 1 .. $current +3);
push(@ret, 0);
push(@ret, $last-1, $last);
} elsif ($current <= ($last - 8)) {
push(@ret, 1, 2);
push(@ret, 0);
push(@ret, $current-3 .. $current+3);
push(@ret, 0);
push(@ret, $last-1, $last);
} elsif ($current <= ($last - 5)) {
push(@ret, 1, 2);
push(@ret, 0);
push(@ret, $current-3 .. $last);
} else {
push(@ret, 1 .. 2);
push(@ret, 0);
push(@ret, ($last -7) .. $last);
}
return @ret;
}
1;
つかいかたとしては、以下のような感じ。
<p class="pager">
[%- FOREACH page = pager.pages_in_flickr %]
[%- IF page == pager.current_page %]
<span class="current_page">[% page %]</span>
[%- ELSIF page == 0 %]
...
[%- ELSE %]
<a href="./?page=[% page %]">[% page %]</a>
[%- END %]
[%- END %]
</p>