SomethingAwful Forums
1.0.0
某種::論壇
use Modern::Perl;
use SomethingAwful::Forums;
use Data::Dumper;
my $SA = SomethingAwful::Forums->new;
$SA->login(
'username' => 'something',
'password' => 'awful',
);
my $scraped_thread = $SA->fetch_posts(
thread_id => 3343753,
pages => 1,
);
# view the data structure
say Dumper( $scraped_thread );
$SA->reply_to_thread( thread_id => 3343753, 'gas' );刮擦並發佈到論壇。Somethingawful.com論壇。
請參閱 /示例文件夾。
# install everything needed by the SomethingAwful::Forums module + examples
cpanm --with-recommends git://github.com/ugexe/SomethingAwful--Forums.gitweb ::刮擦刮板刮擦論壇的索引頁面。
Web ::用於刮擦特定論壇的刮板。
Web ::刮板用於刮擦特定線程。
包含論壇索引的URL。如果DNS無法解決,則允許使用IP地址。
www ::機械化對象內部用於導航網頁。
如果成功登錄,則返回1。
$SA->login( username => $username, password => $password )使用傳遞的憑據登錄到論壇。
$SA->reply_to_thread( thread_id => $thread_id, body => $body )回复特定線程
$SA->reply_to_post( post_id => $post_id, body => $body )回复特定帖子。
$SA->fetch_forums返回代表刮擦論壇索引的哈希夫。
$SA->fetch_threads( forum_id => $forum_id, pages => [1,2] )返回一個hashref代表從提供的論壇ID的提供的頁面上刮除的線程。
$SA->fetch_posts( thread_id => $forum_id, pages => [1,2] )返回一個從提供的線程ID的提供的頁面上刮除的帖子的hashref。
ugexe
該庫是免費的軟件,您可以將其重新分配和/或以與Perl本身相同的條款進行修改。