#!/usr/bin/env perl use strict; use warnings; use lib ('lib'); use YAML::Syck; use Lifestream; use Getopt::Long; my $options = GetOptions( 'config=s' => \my $config, 'deploy' => \my $deploy, 'add' => \my $add, 'url=s' => \my $url, 'name=s' => \my $name, 'start' => \my $start, 'profile=s' => \my $profile, ); my $yaml_conf = LoadFile($config); my $schema = Lifestream::Schema->connect( @{ $yaml_conf->{connect_info} } ); if ($deploy) { $schema->deploy; } if ($add) { $schema->resultset('Feed')->create( { feed_url => $url, name => $name, profile_url => $profile, } ); } if ($start) { my $app = Lifestream->app( config => LoadFile($config) ); if ( $0 eq __FILE__ ) { require Tatsumaki::Server; Tatsumaki::Server->new( port => 9999, host => 0, )->run($app); } else { return $app; } }