Skip to content

Instantly share code, notes, and snippets.

@sng2c
Last active December 18, 2015 01:29
Show Gist options
  • Save sng2c/5704018 to your computer and use it in GitHub Desktop.
Save sng2c/5704018 to your computer and use it in GitHub Desktop.
#!/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