AMF-Connection

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

lib/AMF/Connection/Message.pm
lib/AMF/Connection/MessageBody.pm
lib/AMF/Connection/MessageHeader.pm
lib/AMF/Connection/OutputStream.pm
Makefile.PL
MANIFEST			This list of files
README
t/00_load.t
TODO
META.yml                                 Module YAML meta-data (added by MakeMaker)
META.json                                Module JSON meta-data (added by MakeMaker)

examples/amfclient.pl  view on Meta::CPAN

#!/usr/bin/env perl

# see http://swxformat.org/php/explorer/

use AMF::Connection;
use HTTP::Cookies;

use JSON;

BEGIN
  {
    no strict 'refs';

    # blessed hash object to JSON object
    map
      {
        my $amf_class = $_;
        my $foo = $amf_class."::TO_JSON";

        # unbless object
        *$foo = sub {
            my $f = $_[0];

            #process_amf_object ($f, $amf_class);

            +{ %{$f} };
          }
      } (
          # add your own remote service classes here - or use an SWFDecompiler

          'flex.messaging.messages.AcknowledgeMessage'
        );

    # blessed hash object to JSON array
    map
      {
        my $foo = $_."::TO_JSON";
        # unbless
        *$foo = sub {
            $_[0]->{'externalizedData'};
          }
      } (
          'flex.messaging.io.ArrayCollection'
        );
  }

my $endpoint = 'http://swxformat.org/php/amf.php';

examples/amfclient.pl  view on Meta::CPAN

my $client = new AMF::Connection( $endpoint );

$client->setEncoding(3);
#$client->setHTTPProxy('http://127.0.0.1:8888');
#$client->addHeader( 'serviceBrowser', 'true' );
$client->setHTTPCookieJar( HTTP::Cookies->new(file => "/tmp/lwpcookies.txt", autosave => 1, ignore_discard => 1 ) );

my $params = [  "italy" ];
my ($response) = $client->call( $service.'.'.$method, $params );

my $json = JSON->new;
$json->ascii(1);
$json->utf8(1);
$json->pretty(1);
$json->allow_blessed(1);
$json->convert_blessed(1);
my $json_data = $json->encode( $response->getData );

if ( $response->is_success ) {
        print $json_data;
} else {

examples/get-brightcove-videos-metadata.pl  view on Meta::CPAN

#!/usr/bin/env perl

# see http://code.google.com/p/get-flash-videos/

use AMF::Connection;
use JSON;

BEGIN
  {
    no strict 'refs';

    # blessed hash object to JSON object
    map
      {
        my $amf_class = $_;
        my $foo = $amf_class."::TO_JSON";

        # unbless object
        *$foo = sub {
            my $f = $_[0];

            #process_amf_object ($f, $amf_class);

            +{ %{$f} };
          }
      } (
          # add your own remote service classes here - or use an SWFDecompiler

          'com.brightcove.templating.SecondaryContentDTO',
	  'com.brightcove.templating.FeaturedItemDTO',
	  'com.brightcove.catalog.trimmed.VideoDTO',
	  'com.brightcove.utils.BrightcoveDateDTO',
	  'com.brightcove.catalog.TagDTO',
	  'com.brightcove.catalog.VideoCuePointDTO'
        );

    # blessed hash object to JSON array
    map
      {
        my $foo = $_."::TO_JSON";
        # unbless
        *$foo = sub {
            $_[0]->{'externalizedData'};
          }
      } (
          'flex.messaging.io.ArrayCollection'
        );
  }

my $endpoint = 'http://c.brightcove.com/services/amfgateway';

examples/get-brightcove-videos-metadata.pl  view on Meta::CPAN

                                                         'featuredLineupFetchInfo' => {
                                                                                        'fetchLevelEnum' => '4',
                                                                                        'contentType' => 'VideoLineup',
                                                                                        'childLimit' => '100'
                                                                                      }
                                                       }
                                                     ];

my $response = $client->call( $service.'.'.$method, $params );

my $json = JSON->new;
$json->ascii(1);
$json->utf8(1);
$json->pretty(1);
$json->allow_blessed(1);
$json->convert_blessed(1);
my $json_data = $json->encode( $response->getData );

if ( $response->is_success ) {
	print $json_data;
} else {



( run in 0.615 second using v1.01-cache-2.11-cpan-140bd7fdf52 )