Changeset 793

Show
Ignore:
Timestamp:
05/23/06 17:50:00
Author:
miyagawa
Message:

Add Sticky Query ApiKey? to LivedoorReader? API requests. Fixes #253

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Subscription/LivedoorReader.pm

    r639 r793  
    130130        } 
    131131    } 
     132 
     133    $self->{mech}->cookie_jar->scan( 
     134        sub { 
     135            my($key, $val) = @_[1,2]; 
     136            if ($key =~ /_sid/) { 
     137                $self->{apikey} = $val; 
     138                return; 
     139            } 
     140        }, 
     141    ); 
    132142} 
    133143 
     
    136146 
    137147    my $uri = URI->new_abs($method, "http://reader.livedoor.com/"); 
    138     $uri->query_param(%$param) if $param
     148    $uri->query_form(%$param, ApiKey => $self->{apikey})
    139149 
    140150    $self->{mech}->get($uri->as_string);