Skip to content

Instantly share code, notes, and snippets.

@kitt-vl
Last active February 23, 2019 12:54
Show Gist options
  • Save kitt-vl/fc7edb451607882ab84dfb1b4d55cb64 to your computer and use it in GitHub Desktop.
Save kitt-vl/fc7edb451607882ab84dfb1b4d55cb64 to your computer and use it in GitHub Desktop.
perl juick_d.pl login password
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