Last active
December 18, 2015 01:29
-
-
Save sng2c/5704018 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use JSON; | |
use LWP::UserAgent; | |
my $m = LWP::UserAgent->new; | |
binmode(STDOUT,':utf8'); | |
my $cookie = ''; # fill the cookie getting with Web Browser Debugger. | |
my $usercode = ''; # fill usercode in movies query | |
$m->default_header(Cookie=>$cookie); | |
my $res = $m->get("http://watcha.net/api/movies?type=eval&count=1000&usercode=$usercode&page=1&more=true"); | |
my $data = from_json( $res->decoded_content ); | |
my @data = @{$data->{data}}; | |
foreach my $d (@data){ | |
my $id = $d->{movie}->{id}; | |
my $cancel = 'http://watcha.net/cancel/movie/'.$id; | |
my $res = $m->get($cancel); | |
print $res->decoded_content."\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment