package Webqq::Client::Plugin::SmartReply;
use JSON;
use AE;
use Encode;
use POSIX qw(strftime);
use Webqq::Client::Util qw(truncate console);
my $API = 'http://www.tuling123.com/openapi/api';
my %lim
ring,"\n";
}
my $reply;
my $data = {};
eval{
$data = JSON->new->utf8->decode($res->content);
};
if($@){
print $@,"\n" if $clien
use JSON;
use Webqq::Client::Util qw(console);
sub Webqq::Client::change_state{
my $self = shift;
return undef if $self->{type} ne 'smartqq';
my $state = shift;
my $api_url = 'http://d
response->content(),"\n" if $self->{debug};
my $json = JSON->new->utf8->decode( $response->content() );
return undef if $json->{retcode} !=0;
console "登录状态已修改
:Openqq::SendGroupMessage;
use parent qw(Plack::Component);
use URI::Escape qw(uri_unescape);
use JSON;
use Encode;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shi
};
my $json = JSON->new->utf8->encode($res);
$responder->([
200,
['Content-Type' => 'text/plain'],
[$json],
]);
penqq::SendDiscussMessage;
use parent qw(Plack::Component);
use URI::Escape qw(uri_unescape);
use JSON;
use Encode;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shi
};
my $json = JSON->new->utf8->encode($res);
$responder->([
200,
['Content-Type' => 'text/plain'],
[$json],
]);
package Webqq::Client::Plugin::Perldoc;
use JSON;
use Webqq::Client::Util qw(console_stderr truncate);
if($^O !~ /linux/){
console_stderr "Webqq::Client::App::Perldoc只能运行在linux系统上\
e_api . $module,(),sub{
my $response = shift;
my $doc;
my $json;
my $code;
if($client->{debug}){
print "GET " . $metacpan
ponse->content;
}
eval{ $json = JSON->new->utf8->decode($response->content);};
unless($@){
if($json->{code} == 404){
return 0;
escape);
use JSON;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shift;
return [
200,
['Content-Type' => 'text/plain'],
[JSON->new->encod
生一个监听本地指定端口的HTTP服务器,用于接收api请求
返回数据完全为JSON格式,接口包括:
获取个人信息 /openqq/get_user_info
获取好友信息
N
use Mojo::Base -base;
use XTaTIK::Model::Products;
use XTaTIK::Model::Quote;
use Mojo::Pg;
use JSON::Meth;
use experimental 'postderef';
has [qw/
pg
/];
sub all {
my $self = shift;
escape);
use JSON;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shift;
return [
200,
['Content-Type' => 'text/plain'],
[JSON->new->encod
ION = '0.005002'; # VERSION
use Mojo::Base -base;
use XTaTIK::Model::Products;
use Mojo::Pg;
use JSON::Meth;
use experimental 'postderef';
my @ACCESSORS = qw/contents created_on
address1 addre
escape);
use JSON;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shift;
return [
200,
['Content-Type' => 'text/plain'],
[JSON->new->encod
package Webqq::Client;
use strict;
use JSON;
use Encode;
use Time::HiRes qw(gettimeofday);
use LWP::Protocol::https;
use Storable qw(dclone);
use List::Util qw(first);
use base qw(Webqq::Message Webqq
package Webqq::Message;
use Webqq::Message::Face;
use JSON;
use Encode;
use Webqq::Client::Util qw(console code2client);
use Scalar::Util qw(blessed);
sub reply_message{
my $client = shift;
my
= shift;
my ($json_txt) = @_;
my $json = undef;
eval{$json = JSON->new->utf8->decode($json_txt)};
console "解析消息失败: $@ 对应的消息内容为: $json_txt\n" if $@ and
$client->{debug};
if(ref $json eq 'HASH' and $json->{retcode}==0){
return {is_success=>1,status=>"发送成功"};
}
else{
return {is_success=>0,status=>"发送失败"};
escape);
use JSON;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shift;
return [
200,
['Content-Type' => 'text/plain'],
[JSON->new->encod
N
use Mojo::Base -base;
use XTaTIK::Model::Products;
use XTaTIK::Model::Quote;
use Mojo::Pg;
use JSON::Meth;
use experimental 'postderef';
my $Blank_Cart_Data = {
contents => [],
total =
4.0;
my $VERSION = 0.11;
my $URL_FORMAT = "http://geohex.net/testcase/hex_v${VERSION}_test_%s.json";
my @CASES = qw!
XY2HEX
code2HEX
code2XY
coord2HEX
coord2XY
!;
my @EXTRA =
use File::Temp qw/tempdir/;
use File::Basename qw/dirname/;
use File::Spec;
use HTTP::Tiny;
use JSON::PP;
main();
sub main {
my $dir = tempdir(CLEANUP => 1);
# download
my $ua = HTTP:
$dir, "$case.json");
my $res = $ua->mirror($url, $path);
die "Failed: $res->{reason}" unless $res->{success};
}
# parse & generate
my @src;
my $json = JSON::PP->new;
escape);
use JSON;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shift;
return [
200,
['Content-Type' => 'text/plain'],
[JSON->new->encod
escape);
use JSON;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shift;
return [
200,
['Content-Type' => 'text/plain'],
[JSON->new->encod
::Openqq::SendSessMessage;
use parent qw(Plack::Component);
use URI::Escape qw(uri_unescape);
use JSON;
use Encode;;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = sh
};
my $json = JSON->new->utf8->encode($res);
$responder->([
200,
['Content-Type' => 'text/plain'],
[$json],
]);
:App::Openqq::SendMessage;
use parent qw(Plack::Component);
use URI::Escape qw(uri_unescape);
use JSON;
use Encode;
sub call{
my $self = shift;
my $client = $self->{client};
my $env = shi
};
my $json = JSON->new->utf8->encode($res);
$responder->([
200,
['Content-Type' => 'text/plain'],
[$json],
]);