#!/usr/bin/perl use strict; use warnings; use Test::More tests => 1; use_ok("POE"); POE::Kernel->run(); __DATA__ use Test::More tests => 5; use POE; use POE::Component::AtomAggregator; use HTTP::Status; use POE::Component::Server::HTTP; our %URLS = ( test1 => \&test1, test2 => \&test2, ); our @test1_xml = ( qq| Xantus Vox 2006-11-27T21:52:49Z David Davis http://xantus.vox.com/ tag:vox.com,2006:6p00b8ea0728391bc0/ Making mistaeks along the way Send a letter to a soldier this holiday tag:vox.com,2006-11-27:asset-6a00b8ea0728391bc000cdf3a30259cb8f 2006-11-27T21:52:49Z 2006-11-27T21:52:49Z David Davis http://xantus.vox.com/


I was a US Army soldier a number of years ago, and one holiday during my service stands out.  I was stationed in Waegwan, South Korea, and I was away from family for nearly a year by the time December rolled around.  I received a letter from a little girl in the states.  The letter was addressed to 'Any Soldier' (see below).  This letter definitely helped me during a depressing time away from family.

So, I'm asking you, my fellow voxers, to take a minute of your time and send a letter or card to a soldier this holiday.

Here's how:

Find a soldier at anysoldier.com, and send them a letter.

Also, you can send cards and letters to a wounded soldier.

Wounded Soldier
Red Cross - Walter Reed Army Medical Center
6900 Georgia Avenue NW - Heaton Pavillion - 3EO5
Washington, DC 20307


Thank you, and Happy Holidays!

-Xantus

]]>
|, qq| Xantus Vox 2006-11-27T21:52:49Z David Davis http://xantus.vox.com/ tag:vox.com,2006:6p00b8ea0728391bc0/ Making mistaeks along the way Vox Hunt: City Love tag:vox.com,2006-11-20:asset-6a00b8ea0728391bc000cdf7e62748094f 2006-11-20T22:18:12Z 2006-11-20T22:18:12Z David Davis http://xantus.vox.com/

Show us why you love the city you live in.
Submitted by meg.



I took this picture at Pier 39 in San Francisco.
]]>
| ); our @test2_xml = @text1_xml; POE::Session->new( _start => \&start, _stop => sub { }, _child => sub { }, handle_feed => \&handle_feed, closeshop => \&closeshop, verify => \&verify, ); POE::Kernel->run(); sub start { my ( $heap, $session, $kernel ) = @_[ HEAP, SESSION, KERNEL ]; my $postback = $session->postback("handle_feed"); $heap->{atomagg} = POE::Component::AtomAggregator->new( callback => $postback ); isa_ok( $heap->{atomagg}, "POE::Component::AtomAggregator" ); $heap->{httpd} = spawn_http_server(12345); $kernel->call( $heap->{atomagg}->{alias}, 'add_feed', $_ ) for ( { name => 'test1', url => 'http://localhost:12345/test1', delay => 1 }, { name => 'test2', url => 'http://localhost:12345/test2', delay => 1 }, ); my @feeds = $heap->{atomagg}->feed_list(); is( @feeds, 2, "Verify two feeds loaded" ); } my %done = ( test1 => 0, test2 => 0 ); my $done = 0; sub handle_feed { my ( $kernel, $session, $heap, $feed ) = ( @_[ KERNEL, SESSION, HEAP ], $_[ARG1]->[0] ); return if $done; isa_ok( $feed, "XML::Atom::Feed" ); my $headlines = $feed->num_headlines; if ( $feed->late_breaking_news ) { $done{ $feed->name }++; $done = 1; for my $test (qw(test1 test2)) { $done = $done{$test}; } $kernel->post( $session, 'closeshop' ) unless $done; } } sub closeshop { my ( $kernel, $heap ) = ( @_[ KERNEL, HEAP ] ); $kernel->post( $heap->{httpd}{httpd}, "shutdown" ); $kernel->post( $heap->{atomagg}->{alias}, 'shutdown' ); $kernel->yield('verify'); } sub verify { my ( $kernel, $heap ) = ( @_[ KERNEL, HEAP ] ); my @feeds = $heap->{atomagg}->feed_list(); is( @feeds, 0, "All feeds have been removed" ); } sub spawn_http_server { my ($port) = shift; return POE::Component::Server::HTTP->new( Port => $port, ContentHandler => { '/' => \&http_handler }, Headers => { Server => 'My Server' }, ); } sub http_handler { my ( $request, $response ) = @_; my $path = $request->uri->path; $path =~ s/^\///; my $xml = &{ $URLS{$path} }(); $response->code( HTTP::Status::RC_OK() ); $response->content($xml); return HTTP::Status::RC_OK(); } sub test1 { my $xml = shift @test1_xml; push @test1_xml, $xml; return $xml; } sub test2 { my $xml = shift @test2_xml; push @test2_xml, $xml; return $xml; }