Twib in Yokoahma.pm 2010/3/5
Upcoming SlideShare
Loading in...5
×
 

Twib in Yokoahma.pm 2010/3/5

on

  • 2,046 views

 

Statistics

Views

Total Views
2,046
Views on SlideShare
1,575
Embed Views
471

Actions

Likes
1
Downloads
2
Comments
0

5 Embeds 471

http://yusukebe.com 415
http://kamawada.com 41
http://yusukebe.typepad.jp 11
http://webcache.googleusercontent.com 3
http://www.hanrss.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Twib in Yokoahma.pm 2010/3/5 Twib in Yokoahma.pm 2010/3/5 Presentation Transcript

  • •  •  • 
  • • 
  • sub run {      my $self = shift;      my $cv          = AnyEvent‐>condvar;      my $feed_reader = AnyEvent::Feed‐>new(          url      => $self‐>url,          interval => $self‐>interval,          on_fetch => sub {              my ( $feed_reader, $entries, $feed, $error ) = @_;              if ( defined $error ) {                  warn "ERROR: $errorn";                  $cv‐>send;                  return;              }              for (@$entries) {                  my $entry = Twib::CLI::Feed::Entry‐>new( $_‐>[1] );                  if( my $post = $self‐>create_post( $entry ) ){                  }              }          }      );      $cv‐>recv;  }  View slide
  • •  –  –  –  •  View slide
  • •  •  –  • 
  • use Noe; #Plack based WAF  use DBIx::Skinny;  use Imager;  use WWW::Favicon;  use LWP::UserAgent;  use Cache::Memcached::Fast; 
  • •  •  package MyApp::Controller::Root;  sub root {      my ( $self, $c  ) = @_;      $c‐>render('index', { message => $c‐>config‐>{message} } );  }  sub hi {      my ( $self, $c ) = @_;      my $name = $c‐>req‐>param('name') || 'nanashi';      $c‐>render('hi', { name => $name } );  }  sub redirect {      my ($self, $c ) = @_;      $c‐>redirect( $c‐>base );  }  1; 
  • •  •  •  •  • 
  •      my $rs = $self‐>schema‐>resultset('Link')‐>search(          $args,          {              order_by => 'tweet_count DESC',              page     => $page,              rows     => $rows,              prefetch => $prefech,          }      );      if (wantarray) {            my $next_page =              $self‐>schema‐>resultset('Link')              ‐>search( {}, { columns => [qw/me.id/], page => $page + 1,  rows => $rows } )‐>next              ? $page + 1              : 0;            return ( $rs, $next_page );      }      else {          return $rs;      } 
  • •  •  • 
  • •  •  •