Skip to content

somethingawful.com perl toolkit for scraping and automated posting

Notifications You must be signed in to change notification settings

ugexe/SomethingAwful--Forums

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

SomethingAwful::Forums

SYNOPSIS

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' );

DESCRIPTION

Scrape and post to the forums.SomethingAwful.com forums.

See /examples folder.

INSTALLATION

# install everything needed by the SomethingAwful::Forums module + examples
cpanm --with-recommends git://github.com/ugexe/SomethingAwful--Forums.git

OBJECTS

index_scraper

Web::Scraper scraper for scraping forum's index page.

forum_scraper

Web::Scraper for scraping a specific forum.

thread_scraper

Web::Scraper for scraping specific thread.

base_url

Contains the URL of the forum index. Allows use of an IP address if DNS fails to resolve.

mech

WWW::Mechanize object used internally to navigate web pages.

logged_in

Returns 1 if it successfully logged in.

METHODS

login

$SA->login( username => $username, password => $password )

Login to forums using passed credentials.

reply_to_thread

$SA->reply_to_thread( thread_id => $thread_id, body => $body )

Reply to a specific thread

reply_to_post

$SA->reply_to_post( post_id => $post_id, body => $body )

Reply to a specific post.

fetch_forums

$SA->fetch_forums

Return a hashref representing the scraped forum index.

fetch_threads

$SA->fetch_threads( forum_id => $forum_id, pages => [1,2] )

Return a hashref repsenting the threads scraped from the supplied pages of the supplied forum id.

fetch_posts

$SA->fetch_posts( thread_id => $forum_id, pages => [1,2] )

Return a hashref repsenting the posts scraped from the supplied pages of the supplied thread id.

AUTHOR

ugexe

LICENSE

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

About

somethingawful.com perl toolkit for scraping and automated posting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages