$id )
The fbml.getCustomTags method of the Facebook API.
=item register_custom_tags( tags => [@json_tags] )
The fbml.registerCustomTags method of the Facebook API.
=item set_ref_handle( handle =
is the only
parameter required.
$client->fbml->upload_native_strings(
native_strings => 'JSON'
);
The format for C<native_strings> is described on the developers wiki:
http://wiki.developer
ype::Format;
use strict;
use warnings;
use base 'Exporter';
our @EXPORT_OK = qw(JSON XML ATOM);
use constant JSON => 0;
use constant XML => 1;
use constant ATOM => 2;
1;
=head1 NAME
Net::OpenS
ants for format-type
=head1 SYNOPSIS
use Net::OpenSocial::Client::Type::Auth qw(JSON XML ATOM);
say JSON;
say XML;
say ATOM;
=head1 DESCRIPTION
Constants for format-type.
But curre
support XML and ATOM format.
=head1 VALUES
=over 4
=item JSON
use JSON encoder/decoder.
See L<Net::OpenSocial::Client::Formatter::JSON> for more detail.
=item XML
use XML encoder/decoder.
Now n
ams);
my $data = $self->mapper->get("$url") || return;
my $res = eval { $self->_json->decode($data) };
my $node = $res->{nodes}->{$page} || {};
my $rss = $node->{att
cial::Client::Protocol::REST->new(
formatter => Net::OpenSocial::CLient::Formatter::JSON->new,
request_builder => Net::OpenSocial::Client::HTTPRequestBuilder::OAuth->new(...),
ironment variables.
=head1 DEPENDENCIES
=over 4
=item L<LWP::UserAgent>
Not in CORE
=item L<JSON>
Not in CORE
=back
=head1 INCOMPATIBILITIES
None reported.
=head1 BUGS AND LIMITATIONS
No
ent::Formatter::JSON;
use Net::OpenSocial::Client::Type::Protocol qw(REST RPC);
use Net::OpenSocial::Client::Type::Auth qw(OAUTH ST);
use Net::OpenSocial::Client::Type::Format qw(JSON XML ATOM);
wit
lt => OAUTH,
);
has 'format_type' => (
is => 'ro',
isa => 'Str',
default => JSON,
);
has 'consumer_key' => (
is => 'ro',
isa => 'Str',
);
has 'consumer_secret' => (
ld_formatter {
my $self = shift;
if ( $self->format_type eq JSON ) {
return Net::OpenSocial::Client::Formatter::JSON->new;
}
# XXX: not supported yet
#elsif ( $self->forma
et::OpenSocial::Client::Type::Auth qw(OAUTH ST);
use Net::OpenSocial::Client::Type::Format qw(JSON XML);
use Net::OpenSocial::Client::Type::Protocol qw(REST RPC);
my $client = Net::OpenSo
ew(
container => $container,
auty_type => OAUTH,
format_type => JSON,
protocol_type => REST,
);
=head3 container
First, you have to prepare L<Net::OpenS
=> q{foobarbuz},
...
);
=head3 format_type
Now it only supports JSON format, so, it sets JSON by default.
=head3 protocol_type
REST or RPC.
REST is set by default.
Make sure th
ironment variables.
=head1 DEPENDENCIES
=over 4
=item L<LWP::UserAgent>
Not in CORE
=item L<JSON>
Not in CORE
=back
=head1 INCOMPATIBILITIES
None reported.
=head1 BUGS AND LIMITATIONS
No
e warnings;
use strict;
use version; our $VERSION = qv('0.0.1');
use LWP::UserAgent;
use JSON qw( from_json );
use WWW::Freelancer::Project;
use WWW::Freelancer::User;
my $user_agent = LWP::UserAge
my $content = $user_agent->get("http://api.freelancer.com/Project/$id.json")
->decoded_content();
return bless from_json($content)->{'project'}, 'WWW::Freelancer::Project';
}
sub get_user
agent->get(
"http://api.freelancer.com/User/Properties.json$query_string")
->decoded_content();
return bless from_json($content)->{'profile'}, 'WWW::Freelancer::User';
}
sub search
ona::Flickr;
use strict;
use base qw(Net::Social::Mapper::Persona::Generic);
use Feed::Find;
use JSON::Any;
use URI;
use Data::Dumper;
our $FLICKR_API_KEY = 'efe286838b28127e10271d239dec10bf';
=hea
$params{api_key} = $self->{_flickr_api_key} || $FLICKR_API_KEY;
$params{format} = 'json';
$params{nojsoncallback} = 1;
my $url = URI->new("http://www.flickr.com/services/res
t/");
$url->query_form(%params);
my $page = $self->mapper->get("$url") || return;
return eval { $self->_json->decode($page) };
}
1;
ocial::Client::Protocol::RPC->new(
formatter => Net::OpenSocial::CLient::Formatter::JSON->new,
request_builder => Net::OpenSocial::Client::HTTPRequestBuilder::OAuth->new(...),
package Net::Social::Mapper::SiteMap;
use strict;
use JSON::Any;
=head1 NAME
Net::Social::Mapper::SiteMap - information about know services around the internet
=head1 SYNOPSIS
my $sitemap = N
A;
my $off = tell($fh);
my $json = JSON::Any->new;
my $data = do { local $/; <$fh> };
seek($fh, $off, 0);
return $self->{_sitemap} ||= $json->decode($data);
}
=head2 profile <se
package Net::Social::Mapper::Persona;
use strict;
use JSON::Any;
=head1 NAME
Net::Social::Mapper::Persona - an object representing an internet persona
=head1 SYNOPSIS
See C<Net::Social::Mapper>
m );
my $page = $self->mapper->get("$url") || return ();
my $info = eval { $self->_json->decode($page) } || return ();
my @personas;
foreach my $url (keys %$info) {
a->{$name} = $attributes->{$key};
}
return $persona;
}
sub _json {
my $self = shift;
return $self->{_json} ||= JSON::Any->new;
}
sub _elsewhere_param {
my $self = shift;
retu
ule::Setup::Plugin::Site::GitHub;
use strict;
use warnings;
use base 'Module::Setup::Plugin';
use JSON;
use LWP::UserAgent;
sub register {
my($self, ) = @_;
$self->add_trigger( before_dump_co
, __PACKAGE__, $Module::Setup::VERSION),
cookie_jar => +{},
);
my $res = $ua->post(
'https://github.com/api/v2/json/repos/create' => \%args
);
$res->is_success;
}
1;
n your system:
./Build dist --gzip=gzip --tar=tar
% Deleting META.json
% Creating META.json
% Creating Task.Joose.Stable-3.04
% Creating Task.Joose.Stable-3.04.tar.gz
tribution tarball is created from.
=head3 distmeta
Creates the F<META.json> file that describes the distribution.
F<META.json> is a file containing various bits of I<metadata> about the
distributio
e
distribution. This file is created as F<META.json> in JSON format.
It is recommended that the C<JSON> module be installed to create it.
If the C<JSON> module is not installed, an internal module su
o write the META.json file, and this
will most likely be fine.
F<META.json> file must also be listed in F<MANIFEST> - if it's not, a
warning will be issued.
The format of F<META.json> file is based
html' },
'ics' => { content_type => 'text/calendar', layout => 0 },
'json' => { content_type => 'application/json', layout => 0 },
'mp' => { content_type => 'text/html' },
'ram' =>
handler-coderef is optional. For
example:
respond_to('html', 'txt', 'xml' => \&xml_handler, 'json');
Once a format is selected (TODO, document this) the handler is then invoked;
if no handler wa
as JSON:
{"br":null}
{"body":{"class":"episode"}}
{"strong":"important content"}
{"a":{"href":"/foo","$":"Link to foo"}}
Note the last two lines. If a tag contains attributes, the JSON val
ue
will be a hash containing those attributes. If a tag doesn't contain
attributes, the JSON value will be either null or a string. If a tag
contains both attributes and a string value, the string w
is converted to a "$" in the JSON/YAML
serialisations, eg:
TAG("po:microsite", "rdf:resource" => "/foo");
As XML:
<po:microsite rdf:resource="/foo"/>
And as JSON:
{"po$microsite":{"rdf$res
~ /^(xml|atom|rss)$/) {
return $self->to_xml();
} elsif ($format eq 'json') {
return $self->to_json();
} elsif ($format eq 'yaml') {
return $self->to_yaml();
} elsi
html();
} else {
croak "Unsupported format";
}
}
sub to_json
{
my ($self) = @_;
return '{' . _to_json(@{$self->{raw}}) . '}';
}
sub to_yaml
{
my ($self) = @_;
retur
{
my ($self) = @_;
return "<?xml version=\"1.0\"?>\n" . _to_xml(@{$self->{raw}});
}
## JSON with HTML syntax highlighting
sub to_html
{
my ($self) = @_;
return "<!DOCTYPE html PUBL
on server response.
=head3 ax_mapping
mapping of recieve values with your application fields in json format.
=cut
__PACKAGE__->mk_accessors(qw(ax_mapping ax_values ax_param));
sub init {
my $