<pre name="code" class="python">{
"BaseResponse": {
"Ret": 0,
"ErrMsg": ""
}
,
"AddMsgCount": 3,
"AddMsgList": [{
"MsgId": "7111408761834680132",
"FromUserName": "@3c0ed6bb7b11a5d2df4202a247063d3b1f0624a820936bf6b6652ebf1e4edd36",
"ToUserName": "@701e5378e9db262f43715d120c5fc2a6edf532c58c604b895097afb41b15cdb7",
"MsgType": 1,
"Content": "ksye",
"Status": 3,
"ImgStatus": 1,
"CreateTime": 1454158484,
"VoiceLength": 0,
"PlayLength": 0,
"FileName": "",
"FileSize": "",
"MediaId": "",
"Url": "",
"AppMsgType": 0,
"StatusNotifyCode": 0,
"StatusNotifyUserName": "",
"RecommendInfo": {
"UserName": "",
"NickName": "",
"QQNum": 0,
"Province": "",
"City": "",
"Content": "",
"Signature": "",
"Alias": "",
"Scene": 0,
"VerifyFlag": 0,
"AttrStatus": 0,
"Sex": 0,
"Ticket": "",
"OpCode": 0
}
,
"ForwardFlag": 0,
"AppInfo": {
"AppID": "",
"Type": 0
}
,
"HasProductId": 0,
"Ticket": "",
"ImgHeight": 0,
"ImgWidth": 0,
"SubMsgType": 0,
"NewMsgId": 7111408761834680132
}
,{
"MsgId": "2156704118524247501",
"FromUserName": "@701e5378e9db262f43715d120c5fc2a6edf532c58c604b895097afb41b15cdb7",
"ToUserName": "@3c0ed6bb7b11a5d2df4202a247063d3b1f0624a820936bf6b6652ebf1e4edd36",
"MsgType": 1,
"Content": "sum amount is 369.2",
"Status": 3,
"ImgStatus": 1,
"CreateTime": 1454158484,
"VoiceLength": 0,
"PlayLength": 0,
"FileName": "",
"FileSize": "",
"MediaId": "",
"Url": "",
"AppMsgType": 0,
"StatusNotifyCode": 0,
"StatusNotifyUserName": "",
"RecommendInfo": {
"UserName": "",
"NickName": "",
"QQNum": 0,
"Province": "",
"City": "",
"Content": "",
"Signature": "",
"Alias": "",
"Scene": 0,
"VerifyFlag": 0,
"AttrStatus": 0,
"Sex": 0,
"Ticket": "",
"OpCode": 0
}
,
"ForwardFlag": 0,
"AppInfo": {
"AppID": "",
"Type": 0
}
,
"HasProductId": 0,
"Ticket": "",
"ImgHeight": 0,
"ImgWidth": 0,
"SubMsgType": 0,
"NewMsgId": 2156704118524247501
}
,{
"MsgId": "4708939637119742326",
"FromUserName": "@3c0ed6bb7b11a5d2df4202a247063d3b1f0624a820936bf6b6652ebf1e4edd36",
"ToUserName": "@701e5378e9db262f43715d120c5fc2a6edf532c58c604b895097afb41b15cdb7",
"MsgType": 51,
"Content": "<msg><br/><op id='1'><br/><username>wxid_8mn2bmkx40so22</username><br/></op><br/></msg>",
"Status": 3,
"ImgStatus": 1,
"CreateTime": 1454158485,
"VoiceLength": 0,
"PlayLength": 0,
"FileName": "",
"FileSize": "",
"MediaId": "",
"Url": "",
"AppMsgType": 0,
"StatusNotifyCode": 1,
"StatusNotifyUserName": "@701e5378e9db262f43715d120c5fc2a6edf532c58c604b895097afb41b15cdb7",
"RecommendInfo": {
"UserName": "",
"NickName": "",
"QQNum": 0,
"Province": "",
"City": "",
"Content": "",
"Signature": "",
"Alias": "",
"Scene": 0,
"VerifyFlag": 0,
"AttrStatus": 0,
"Sex": 0,
"Ticket": "",
"OpCode": 0
}
,
"ForwardFlag": 0,
"AppInfo": {
"AppID": "",
"Type": 0
}
,
"HasProductId": 0,
"Ticket": "",
"ImgHeight": 0,
"ImgWidth": 0,
"SubMsgType": 0,
"NewMsgId": 4708939637119742326
}
],
"ModContactCount": 0,
"ModContactList": [],
"DelContactCount": 0,
"DelContactList": [],
"ModChatRoomMemberCount": 0,
"ModChatRoomMemberList": [],
"Profile": {
"BitFlag": 0,
"UserName": {
"Buff": ""
}
,
"NickName": {
"Buff": ""
}
,
"BindUin": 0,
"BindEmail": {
"Buff": ""
}
,
"BindMobile": {
"Buff": ""
}
,
"Status": 0,
"Sex": 0,
"PersonalCard": 0,
"Alias": "",
"HeadImgUpdateFlag": 0,
"HeadImgUrl": "",
"Signature": ""
}
,
"ContinueFlag": 0,
"SyncKey": {
"Count": 7,
"List": [{
"Key": 1,
"Val": 646985714
}
,{
"Key": 2,
"Val": 646985938
}
,{
"Key": 3,
"Val": 646985901
}
,{
"Key": 11,
"Val": 646985807
}
,{
"Key": 13,
"Val": 646980079
}
,{
"Key": 201,
"Val": 1454158485
}
,{
"Key": 1000,
"Val": 1454151272
}
]
}
,
"SKey": ""
}
foreach $j (@{$d->{AddMsgList}}) {
if ("$j->{MsgType}" == 1){
print "$message is $j->{Content}
";
print "
";}}
@{$d->{AddMsgList}} 代表数组,每个元素为一个引用
$j 每个元素内容,是个引用,内容如下:
foreach $j (@{$d->{AddMsgList}}) {
use Data::Dumper;
print "$j ------------
";
my $var= Dumper($j);
# my $var=encode("gbk",decode("utf8","$var"));
print $var;
print "
";
if ("$j->{MsgType}" == 1){
print "$message is $j->{Content}
";
print "
";
$VAR1 = {
'AppMsgType' => 0,
'ImgWidth' => 0,
'RecommendInfo' => {
'NickName' => '',
'Ticket' => '',
'Scene' => 0,
'Sex' => 0,
'VerifyFlag' => 0,
'City' => '',
'OpCode' => 0,
'UserName' => '',
'Alias' => '',
'AttrStatus' => 0,
'Signature' => '',
'Province' => '',
'QQNum' => 0,
'Content' => ''
},
'Status' => 3,
'MediaId' => '',
'PlayLength' => 0,
'ImgHeight' => 0,
'MsgType' => 1,
'FromUserName' => '@@96f792ed54709c3c332a8af525245edf7a02c9f6a4f44c8fd8690879ee43d160',
'FileSize' => '',
'Ticket' => '',
'ToUserName' => '@ce07b1981eba3bf5537604c86df4168b584f63b0c42dd4e856476aa1871d3a6a',
'StatusNotifyCode' => 0,
'ForwardFlag' => 0,
'CreateTime' => 1454567096,
'ImgStatus' => 1,
'NewMsgId' => '7710321923006839378',
'StatusNotifyUserName' => '',
'FileName' => '',
'SubMsgType' => 0,
'HasProductId' => 0,
'Content' => '@7bee9abbb9ed2f45bf9b6cf2c38fb6253e90d9cc4b9619f254977690e525c8a9:<br/>639955',
'Url' => '',
'AppInfo' => {
'Type' => 0,
'AppID' => ''
},
'MsgId' => '7710321923006839378',
'VoiceLength' => 0
};