Group
Extension

Matches 35359

Any-Renderer ( K/KM/KMCGRATH/Any-Renderer-1.015_02.tar.gz, KMCGRATH, 2011; MetaCPAN )
Any-Renderer/lib/Any/Renderer.pm ( view source; MetaCPAN )
 include:

	- XML (via XML::Simple)
	- XML+XSLT
	- Data::Dumper
	- Javascript, Javascript::Anon & JSON
	- UrlEncoded
	- The formats supported by Data::Serializer (e.g. Config::General and Config::Wres
WebService-NFSN ( C/CJ/CJM/WebService-NFSN-1.02.tar.gz, CJM, 2011; MetaCPAN )
WebService-NFSN/lib/WebService/NFSN/Object.pm ( view source; MetaCPAN )
========
sub get_converter # ($function)
{
  my $convert = ($_[0] =~ s/:JSON$//
                 ? 'WebService::NFSN::decode_json'
                 : '');

  return $convert;
} # end get_converter

#-
Weather-TW ( D/DR/DRYMAN/Weather-TW-0.500002.tar.gz, DRYMAN, 2011; MetaCPAN )
Weather-TW/lib/Weather/TW.pm ( view source; MetaCPAN )
encode decode/;
use LWP::UserAgent;
use HTML::TreeBuilder;
use HTML::Element;
use XML::Smart;
use JSON;
use YAML qw(Dump);
use utf8;
use Carp;



my %area_zh = (
  '台北市'      => '36_01_data.htm'
my $weather = Weather::TW->new;
    my $xml = $weather->area('Taipei City')->xml;
    my $json = $weather->json;
    my $yaml = $weather->yaml;
    my %hash = $weather->hash;
  
    foreach my $area (
PTION

This module parse data from L<http://www.cwb.gov.tw/> (中央氣象局), and generates xml/json/hash/yaml data.

=head1 OLD METHODS

=over

=item C<< new >>

Create a new C<Weather::TW> object.
WWW-DataWiki ( T/TO/TOBYINK/WWW-DataWiki-0.001.tar.gz, TOBYINK, 2011; MetaCPAN )
WWW-DataWiki/lib/WWW/DataWiki/Trait/RdfModel.pm ( view source; MetaCPAN )
WWW::DataWiki::FMT_NT,    0.6, 'text/plain',  undef, 'utf-8'],
			[WWW::DataWiki::FMT_JSON,  0.6, 'application/json',      undef, 'utf-8'],
			[WWW::DataWiki::FMT_XML,   0.6, 'application/rdf+xml',   
ation/rdf+xml',
			'.xhtml'=> 'application/xhtml+xml',
			'.html' => 'text/html',
			'.json' => 'application/json',
			};
	}

	method rdf_string_conforms_to ($format)
	{
		return 1 if $format eq WWW::
WWW-DataWiki ( T/TO/TOBYINK/WWW-DataWiki-0.001.tar.gz, TOBYINK, 2011; MetaCPAN )
WWW-DataWiki/lib/WWW/DataWiki/Trait/ResultSet.pm ( view source; MetaCPAN )
'application/sparql-results+xml', undef, 'utf-8'],
			[WWW::DataWiki::FMT_RS_JSON,  0.9, 'application/x-sparql-results+json', undef, 'utf-8'],
			[WWW::DataWiki::FMT_RS_TEXT,  0.6, 'text/plain', undef
s+xml',
			'.xhtml'=> 'application/xhtml+xml',
			'.html' => 'text/html',
			'.json' => 'application/x-sparql-results+json',
			'.txt'  => 'text/plain',
			'.csv'  => 'text/csv',
			'.tab'  => 'text/t
s_string_as ($fmt)
	{
		my $str;
		given ($fmt)
		{
			when (WWW::DataWiki::FMT_RS_JSON)  { $str = $self->rs->as_json; }
			when (WWW::DataWiki::FMT_RS_XML)   { $str = $self->rs->as_xml; }
			when (WW
WWW-DataWiki ( T/TO/TOBYINK/WWW-DataWiki-0.001.tar.gz, TOBYINK, 2011; MetaCPAN )
WWW-DataWiki/lib/WWW/DataWiki/HowNotToDoIt.pod ( view source; MetaCPAN )
e; charset=utf-8',
      'rdf'       => 'application/rdf+xml; charset=utf-8',
      'json'      => 'application/json',
      }->{$variant} || 'application/octet-stream';
    
    $headers{'Content-Typ
xml/i)        { $parser = RDF::Trine::Parser::RDFXML->new; }
      when (/json/i)       { $parser = RDF::Trine::Parser::RDFJSON->new; }
      when (/text.plain/i) { $parser = RDF::Trine::Parser::NTrip
Triples), application/xhtml+xml (i.e. XHTML+RDFa 1.0), application/rdf+xml and application/json (i.e. RDF/JSON).');
      }
    }
    
    # Check it's syntactically sound
    my $model;
    
    if (
WWW-DataWiki ( T/TO/TOBYINK/WWW-DataWiki-0.001.tar.gz, TOBYINK, 2011; MetaCPAN )
WWW-DataWiki/lib/WWW/DataWiki/Controller/Page.pm ( view source; MetaCPAN )
-9-]*[a-z0-9])(?:/[a-z][a-z0-9-]*[a-z0-9])*)';
	our $RE_ext  = '(\.nt|\.n3|\.ttl|\.x?html|\.xml|\.json|\.txt|\.csv|\.tab)';
	our $RE_path = "${RE_page}${RE_ext}?";
	our $RE_vid  = '(\d{4}(?:\d{2}(?:\d
plication/sparql-update, text/n3, text/turtle, text/plain, application/rdf+xml;q=0.5, application/json;q=0.1, application/xhtml+xml;q=0.1, text/html;q=0.1'});
		}
	}

	action wikipage_PATCH
	{
		my ($
s.',
				{'X-Accept' => 'text/n3, text/turtle, text/plain, application/rdf+xml;q=0.5, application/json;q=0.1, application/xhtml+xml;q=0.1, text/html;q=0.1'});
		}
	}

	action wikipage_DELETE
	{
		my (
Data-MultiValued ( D/DA/DAKKAR/Data-MultiValued-0.0.1_4.tar.gz, DAKKAR, 2011; MetaCPAN )
Data-MultiValued/lib/Data/MultiValued.pm ( view source; MetaCPAN )
ey are optimised for serialisation, see
L<Data::MultiValued::UglySerializationHelperRole> and F<t/json.t>.

=item *

you get accessors generated for your Moose attributes just by setting
a trait

=ite
Acme-JWT ( C/CL/CLAIRVY/Acme-JWT-0.04.tar.gz, CLAIRVY, 2011; MetaCPAN )
Acme-JWT/lib/Acme/JWT.pm ( view source; MetaCPAN )
package Acme::JWT;
use strict;
use warnings;
our $VERSION = '0.04';

use JSON qw/decode_json encode_json/;
use MIME::Base64 qw/encode_base64url decode_base64url/;
use Try::Tiny;
use Digest::SHA qw/hma
=> $algorithm,
    };
    push(@$segments, encode_base64url(encode_json($header)));
    push(@$segments, encode_base64url(encode_json($payload)));
    my $signing_input = join('.', @$segments);
    un
 $payload;
    my $signature;
    try {
        $header = decode_json(decode_base64url($header_segment));
        $payload = decode_json(decode_base64url($payload_segment));
        $signature = decod
WWW-DataWiki ( T/TO/TOBYINK/WWW-DataWiki-0.001.tar.gz, TOBYINK, 2011; MetaCPAN )
WWW-DataWiki/lib/WWW/DataWiki.pm ( view source; MetaCPAN )
		FMT_XHTML  => 'XHTML',
		FMT_HTML   => 'HTML',
		FMT_JSON   => 'RDFJSON',
		};

	use constant {
		FMT_RS_XML   => 'xml',
		FMT_RS_JSON  => 'json',
		FMT_RS_TEXT  => 'txt',
		FMT_RS_HTML  => 'html',
point. HTTP content negotiation serves up graph data as HTML, Turtle,
RDF/XML, JSON; and query results as HTML, XML, JSON, CSV or tab-delimited data.

WWW::DataWiki is fully RESTful, using HTTP B<GET>
WWW-DataWiki ( T/TO/TOBYINK/WWW-DataWiki-0.001.tar.gz, TOBYINK, 2011; MetaCPAN )
WWW-DataWiki/lib/WWW/DataWiki/Resource/Container.pm ( view source; MetaCPAN )
>uri, 'n3'), ')',
									' (', a(-rel=>'rel:alternate', -href=>$ver->formatted_page_iri('json')->uri, 'json'), ')',
									br(
										-property => 'awol:published',
										-content  => $publ
WWW-DataWiki ( T/TO/TOBYINK/WWW-DataWiki-0.001.tar.gz, TOBYINK, 2011; MetaCPAN )
WWW-DataWiki/lib/WWW/DataWiki/Utils.pm ( view source; MetaCPAN )
html\+xml}i;
		
		return WWW::DataWiki->FMT_JSON  if $format =~ m{^(RDF[\s_/-]?)?JSON}i;
		return WWW::DataWiki->FMT_JSON  if $format =~ m{^application/json}i;
		
		return WWW::DataWiki->FMT_XML   if 
Data-MultiValued ( D/DA/DAKKAR/Data-MultiValued-0.0.1_4.tar.gz, DAKKAR, 2011; MetaCPAN )
Data-MultiValued/lib/Data/MultiValued/UglySerializationHelperRole.pm ( view source; MetaCPAN )
tt',
 );

Later:

  my $json = JSON::XS->new->utf8;
  my $obj = My::Class->new(rr=>'foo');

  my $str = $json->encode($obj->as_hash);

  my $obj2 = My::Class->new_in_place($json->decode($str));

  # $
Net-ZooTool ( Q/QU/QUELCOM/Net-ZooTool-0.0031.tar.gz, QUELCOM, 2011; MetaCPAN )
Net-ZooTool/lib/Net/ZooTool/Utils.pm ( view source; MetaCPAN )
package Net::ZooTool::Utils;

use Moose::Role;

use JSON::XS;
use Carp;
use Data::Dumper;
use Digest::SHA1 qw/sha1_hex/;
use WWW::Curl::Easy;

use namespace::autoclean;

our $VERSION = '0.003';

=head
URLINFO_HTTP_CODE);
        # judge result and next action based on $response_code
        return JSON::XS->new->utf8->decode($response_body);
    }
    else {
        carp(   "An error happened: $ret
WWW-DataWiki ( T/TO/TOBYINK/WWW-DataWiki-0.001.tar.gz, TOBYINK, 2011; MetaCPAN )
WWW-DataWiki/lib/WWW/DataWiki/Controller/Container.pm ( view source; MetaCPAN )
pplication/sparql-query, text/n3, text/turtle, text/plain, application/rdf+xml;q=0.5, application/json;q=0.1, application/xhtml+xml;q=0.1, text/html;q=0.1'});
		}
	}

	action container_OPTIONS
	{
		my
Mail-Builder-Simple ( T/TE/TEDDY/Mail-Builder-Simple-0.16.tar.gz, TEDDY, 2011; MetaCPAN )
Mail-Builder-Simple/lib/Mail/Builder/Simple.pm ( view source; MetaCPAN )
 any type of file supported by L<Config::Any|Config::Any>: Apache config style (Config::General), JSON, INI files, XML, YAML or perl code.

Here is an example of a configuration file that uses L<Confi
AnyEvent-JSONRPC-Lite ( T/TY/TYPESTER/AnyEvent-JSONRPC-Lite-0.15.tar.gz, TYPESTER, 2011; MetaCPAN )
AnyEvent-JSONRPC-Lite/lib/AnyEvent/JSONRPC/Lite/Server.pm ( view source; MetaCPAN )
package AnyEvent::JSONRPC::Lite::Server;
use Any::Moose;

use Carp;
use Scalar::Util 'weaken';

use AnyEvent::Handle;
use AnyEvent::Socket;

use AnyEvent::JSONRPC::Lite::CondVar;

has address => (
   
            fh => $fh,
        );
        $handle->on_read(sub {
            shift->unshift_read( json => sub {
                $self->_dispatch($indicator, @_);
            }),
        });

        $
$type   = shift;
            my $result = @_ > 1 ? \@_ : $_[0];

            $handle->push_write( json => {
                id     => $id,
                result => $type eq 'result' ? $result : undef
Alice ( L/LE/LEEDO/Alice-0.20.tar.gz, LEEDO, 2011; MetaCPAN )
Alice/lib/Alice/HTTP/Server.pm ( view source; MetaCPAN )

use Alice::HTTP::Request;
use Alice::HTTP::Stream::XHR;
use Alice::HTTP::Stream::WebSocket;

use JSON;
use Encode;
use Any::Moose;

has app => (
  is  => 'ro',
  isa => 'Alice',
  required => 1,
);

new_server', $name);
  my $listitem = $self->render('server_listitem', $name);
  
  $res->body(to_json({config => $config, listitem => $listitem}));
  $res->header("Cache-control" => "no-cache");
  $r
$self, $req, $res) = @_;
  $res->content_type("text/plain; charset=utf-8");
  {
    $res->body(to_json($self->app->config->serialized,
      {utf8 => 1, pretty => 1}));
  }
  $res->send;
}

__PACKAGE_
Alice ( L/LE/LEEDO/Alice-0.20.tar.gz, LEEDO, 2011; MetaCPAN )
Alice/lib/Alice/HTTP/Stream/WebSocket.pm ( view source; MetaCPAN )
package Alice::HTTP::Stream::WebSocket;

use JSON;
use Any::Moose;
use Digest::MD5 qw/md5/;
use Time::HiRes qw/time/;

extends 'Alice::HTTP::Stream';

has fh => (
  is => 'ro',
  required => 1,
);

ha
$_[0]->push_read(
      'AnyEvent::Handle::Message::WebSocket',
      sub { $self->on_read->(from_json $_[1]) }
    );
  });
    
  $self->handle($h);
  $self->send([{type => "identify", id => $self->
lf, $messages) = @_;

  $messages = [$messages] unless ref $messages eq "ARRAY";

  my $line = to_json(
    {queue => $messages},
    {utf8 => 1, shrink => 1}
  );
  
  $self->send_raw($line);
}

sub 
JSON-signature-to-image ( T/TU/TURNERJW/JSON-signature-to-image-1.0.tar.gz, TURNERJW, 2011; MetaCPAN )
JSON-signature-to-image/test.pl ( view source; MetaCPAN )
ry.)

BEGIN { $| = 1; print "1..3\n"; }
END {print "not ok 1\n" unless $loaded;}
use GD;
use JSON::Parse;
$loaded = 1;
print "ok 1\n";

######################### End of black magic.
# Insert

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.