$json = $self->http_post($api,{Referer=>"http://qun.qq.com/member.html",json=>1},form=>{gc=>$uid,ul=>join("|",@qq),bkn=>$self->get_csrf_token});
return if not defined $json;
return if $json->
2';
my $headers = {Referer=>'https://s.web2.qq.com/proxy.html?v=20130916001&callback=1&id=1',json=>1};
my @query_string = (
tuin => $uin,
type => 1,
$json = $self->http_get($self->gen_url($api_url,@query_string),$headers);
return undef unless defined $json;
return undef if $json->{retcode} !=0;
$self->id_to_qq_cache->store($uin,$json-
>{result}{account});
return $json->{result}{account};
}
1;
rs = {
Referer=>'https://s.web2.qq.com/proxy.html?v=20130916001&callback=1&id=1',
json=>1,
ua_request_timeout => $self->model_update_timeout,
ua_retry_times => 3,
}
?0:1;
my $handle = sub{
my $json = shift;
my $friends_state = shift;
return undef unless defined $json;
return undef if $json->{retcode}!=0 ;
my %categories
$state{$_->{uin}}{client_type} = $_->{client_type};
}
}
for(@{ $json->{result}{categories}}){
$categories{ $_->{'index'} } = {'sort'=>$_->{'sort'},name=>$
= {
Referer => 'http://d1.web2.qq.com/proxy.html?v=20151105001&callback=1&id=2',
json => 1,
};
my @query_string = (
vfwebqq => $self->vfwebqq,
clie
:1;
my $handle = sub {
my $json = shift;
return undef unless defined $json;
return undef if $json->{retcode} !=0;
for(@{$json->{result}}){
$_->{client_t
$_->{state} = $_->{status};
delete $_->{status};
}
return $json->{result};
};
if($is_blocking){
return $handle->( $self->http_get($self->gen_url
= {
Referer => 'https://s.web2.qq.com/proxy.html?v=20130916001&callback=1&id=1',
json=>1,
ua_request_timeout => $self->model_update_timeout,
ua_retry_times => 3,
}
dle = sub{
my $json = shift;
return undef unless defined $json;
return undef unless exists $json->{result}{gnamelist};
my $group_list_info = $json->{result}{gnamelist};
$self->to_json(\%r)},) );
}
else{
$self->http_get($api_url,$headers,form=>{r=>$self->to_json(\%r)},sub{
my $json = shift;
$callback->( $handle->($json) );
qinfo.clt.qq.com/cgi-bin/qun_info/set_group_admin";
my $json = $self->http_post($api,{Referer=>"http://qinfo.clt.qq.com/member.html",json=>1},
form=>{src=>"qinfo_v2",gc=>$uid,u=>join("
|",$qq[0]),op=>0,bkn=>$self->get_csrf_token});
return if not defined $json;
return if $json->{ec}!=0;
return 1;
}
1;
::BitBucketCli::Link->new(%{ $args->{link} });
}
return $class->$orig($args);
};
sub TO_JSON {
my ($self) = @_;
return { %{ $self } };
}
1;
__END__
=head1 NAME
App::BitBucketCli:
will automatically get id, link and links attributes
# Also will autmatically be dumpable by L<JSON::XS>
=head1 DESCRIPTION
This is the base class for L<App::BitBucket::Project>, L<App::BitBucke
cket::Repository>, ...
=head1 SUBROUTINES/METHODS
=head2 C<BUILDARGS ()>
=head2 C<TO_JSON ()>
Used by L<JSON::XS> for dumping the object
=head1 ATTRIBUTES
=head2 id
Most BitBucket objects retur
/;
}
sub to_json_hash{
my $self = shift;
my $json = {};
for my $key (keys %$self){
next if substr($key,0,1) eq "_";
if($key eq "sender"){
$json->{sender} = $
ame;
$json->{sender_uid} = $self->sender->uid;
}
elsif($key eq "receiver"){
$json->{receiver} = $self->receiver->displayname;
$json->{receiver_uid}
group"){
$json->{group} = $self->group->displayname;
$json->{group_uid} = $self->group->uid;
}
elsif($key eq "discuss"){
$json->{discuss} = $self->d
p_message{
my($self,$msg) = @_;
my $callback = sub{
my $json = shift;
$msg->parse_send_status_msg( $json );
if( !$msg->is_success and $msg->ttl > 0){
$self-
= {
Referer => 'http://d1.web2.qq.com/proxy.html?v=20151105001&callback=1&id=2',
json => 1,
};
my @content = map {
if($_->{type} eq "txt"){$_->{content}}
$msg->group_id,
face => $self->user->face || 591,
content => $self->to_json($content),
msg_id => $msg->id,
clientid => $self->clientid,
psess
alar::Util qw(blessed);
use Data::Dumper;
sub client {
return $Mojo::Webqq::_CLIENT;
}
sub to_json_hash{
my $self = shift;
my $hash = {};
for(keys %$self){
next if substr($_
eq "ARRAY"){
for my $m(@{$self->{member}}){
my $member_hash = $m->to_json_hash();
push @{$hash->{member}},$member_hash;
}
}
}
OpenStack::Client;
use strict;
use warnings;
use HTTP::Request ();
use LWP::UserAgent ();
use JSON ();
use URI::Encode ();
use OpenStack::Client::Response ();
our $VERSION = '1.0007';
=e
$request->content($args{'body'});
} else {
$request->content(JSON::encode_json($args{'body'}));
}
}
return bless $self->{'ua'}->request($request,
Defaults to C<application/json, text/plain>.
=item Accept-Encoding
Defaults to C<identity, gzip, deflate, compress>.
=item Content-Type
Defaults to C<application/json>, although some API calls (
nt;
$client->http_post($api_url,
{'Authorization'=>"key=$api_key",json=>1},
json=>{
registration_ids=> $registration_ids,
$collapse_key
"message_id":"0:1484103730761325%9b9e6c13f9fd7ecd"}]}"
my $json = shift;
if(not defined $json){
$client->debug("[".__PACKAGE__."]GCM消息推送失
$client->debug("[".__PACKAGE__."]GCM消息推送完成:$json->{multicast_id}/$json->{success}/$json->{failure}");
}
}
);
});
$client
method will return an object containing the following:
=over
=item * response
The full decoded JSON authorization response from Keystone
=item * services
A hash containing services the client has
ge;
$client->http_post($api_url,
{'Authorization'=>"key=$api_key",json=>1},
json=>{
registration_ids=> $registration_ids,
$collapse_key
"message_id":"0:1484103730761325%9b9e6c13f9fd7ecd"}]}"
my $json = shift;
if(not defined $json){
$client->debug("[".__PACKAGE__."]GCM消息推送失
$client->debug("[".__PACKAGE__."]GCM消息推送完成:$json->{multicast_id}/$json->{success}/$json->{failure}");
}
}
);
});
$client
$msg->allow_plugin(0);
my $salt = time;
$client->http_get($api,{json=>1},form=>{
q => $query,
from => 'auto',
to
b{
my $json = shift;
if( not defined $json ){$msg->reply("翻译失败: api接口不可用")}
elsif(defined $json and exists $json->{error_code}){
可用(" . $json->{error_code} . " " . $json->{error_msg} . ")");
}
elsif(defined $json){
$msg->reply( join " ",map {$_->{dst}} @{ $json->{trans_re
de($signtemp . $orignal,"");
my $json = $client->http_post("http://web.file.myqcloud.com/files/v1/$appid/$bucket/$name",
{ Authorization=>$sign, json=>1 ,ua_debug_req_body=>0},
fo
);
if(not defined $json){
$client->warn("二维码图片上传云存储失败: 响应数据异常");
return;
}
elsif(defined $json and $json->{code} != 0 ){
$c
lient->warn("二维码图片上传云存储失败: " . $json->{message});
return;
}
my $url = $json->{data}{source_url};
$url=~s/(^https?:\/\/)([^\/]+)(.*)/$1$mydomain$3/ if (
path' => '/auth/tokens',
'body' => \%request
);
my $body = $response->decode_json;
unless (defined $response->header('X-Subject-Token')) {
die 'No token found in resp
$senderType = '2';
}
return if !$title or !$message;
my $messageJson = '{"content":"{\"isAt\":\"'.$isAt.'\",\"type\":\"'.$type.'\",\"title\":\"'.$title.'\",\"message\
}"}';
print "appId=".$app_id."messageJson=".$messageJson."pushIds=".$registration_id.$api_key;
my $sign = md5_sum("appId=".$app_id."messageJson=".$messageJson."pushIds=".$registration_id.$api_key)
=>1,ua_debug_res_body=>1,json=>1},
form=>{
appId => $app_id,
pushIds => $registration_id,
messageJson=>$messageJson,
sign => $sign,
e,{json=>1},sub{
my $json = shift;
return unless defined $json;
my $doc;
my $code;
if(defined $json->{code} and $json->{
code} == 404){
$doc = "模块名称: $module ($json->{message})" ;
$code = 404;
$metacpan_cache->store($module,{code=>$code,doc=>$doc},6048
= 200;
my $author = $json->{author};
my $version = $json->{version};
my $abstract= $json->{abstract};
my $podlin
的云存储路径,防止好像干扰
my $json = $client->http_post('https://sm.ms/api/upload',{json=>1},form=>{
format=>'json',
smfile=>{filename=>$qrcode_path,conte
if(not defined $json){
$client->warn("二维码图片上传云存储失败: 响应数据异常");
return;
}
elsif(defined $json and $json->{code} ne 'succes
存储失败: " . $json->{msg});
return;
}
$client->qrcode_upload_url($json->{data}{url});
$client->info("二维码已上传云存储[ ". $json->{data}{url} . " ]")