Last active
February 23, 2019 12:54
-
-
Save kitt-vl/fc7edb451607882ab84dfb1b4d55cb64 to your computer and use it in GitHub Desktop.
perl juick_d.pl login password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Mojo::Base -base; | |
use ojo; | |
my ($link, $pass) = (shift,shift); | |
say "use $0 login password" and exit unless $link and $pass; | |
my $login = p('https://juick.com/login' => form => {username => $link, password => $pass}); | |
say 'Auth failed' and exit unless $login->dom->at('div#ctitle a'); | |
my $url = 'https://juick.com/' . $link; | |
while($url){ | |
my $dom = g($url)->dom; | |
$dom->find('section#content article')->each(sub{ | |
my $post_link = $_->at('div.msg-ts a')->{href}; | |
my ($post_num) = $post_link =~ /(\d+)/; | |
my $hash = $dom->at('body#body')->{'data-hash'}; | |
my $post_del = 'https://juick.com/api/post?hash=' . $hash; | |
my $res = p($post_del => { referer => 'https://juick.com/post?body=D+%23' . $post_num } => form =>{ body => 'D #' . $post_num}); | |
say $post_del . ' id=' . $post_num . ' res=' . $res->body; | |
}); | |
my $next = $dom->at('p.page a'); | |
if($next){ | |
$url = 'https://juick.com/' . $link . '/' . $next->{href}; | |
say $url; | |
}else{ | |
$url =''; | |
say "DELETE $link JUICK FINISHED!"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment