BusyBird-Input-Feed

 view release on metacpan or  search on metacpan

t/samples.t  view on Meta::CPAN

              busybird => sh( status_permalink => 'http://stackoverflow.com/questions/24593002/hide-softkeyboard-when-it-is-called-from-menuitem',
                              original => sh( id => 'http://stackoverflow.com/q/24593002' )),
              created_at => 'Sun Jul 06 05:31:56 +0000 2014',
              user => sh( screen_name => 'Recent Questions - Stack Overflow' )),
      ]},
    { filename => 'googlejp.atom',
      exp_num => 25,
      exp_partial => [
          sh( id => '1404701402|tag:blogger.com,1999:blog-20042392.post-2515664455683743324',

              ## status text should be decoded.
              text => 'あたらしい「ごちそうフォト」で、あなたがどんな食通かチェックしましょう。',
              
              ## if there are multiple <link>s, use rel="alternate".
              busybird => sh( status_permalink => 'http://feedproxy.google.com/~r/GoogleJapanBlog/~3/RP_M-WXr_6I/blog-post.html',
                              original => sh( id => 'tag:blogger.com,1999:blog-20042392.post-2515664455683743324' )),

              ## <updated> is used instead of <published>
              created_at => 'Mon Jul 07 11:50:02 +0900 2014',
              user => sh( screen_name => 'Google Japan Blog' ),

xt/run.t  view on Meta::CPAN

    check_output $output;
}

{
    note("--- URL -> URL");
    my $ua = Test::LWP::UserAgent->new(network_fallback => 1);
    my $output;
    $ua->env_proxy;
    $ua->map_response(qr{/timelines/home/statuses\.json}, sub {
        my ($request) = @_;
        $output = $request->decoded_content;
        my $mocked_res = HTTP::Response->new(200);
        $mocked_res->header('Content-Type' => 'application/json; charset=utf-8');
        $mocked_res->content(q{{"error":null,"count":10}});  ## count may be wrong...
        return $mocked_res;
    });
    BusyBird::Input::Feed::Run->run(
        download_url => 'http://rss.slashdot.org/Slashdot/slashdot',
        post_url => 'http://hogehoge.com/timelines/home/statuses.json',
        user_agent => $ua
    );



( run in 0.769 second using v1.01-cache-2.11-cpan-26ccb49234f )