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本身相同的条款进行修改。