Weixin复杂数据2
2016-02-04 14:25
716 查看
<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}\n"; print "\n";}} @{$d->{AddMsgList}} 代表数组,每个元素为一个引用 $j 每个元素内容,是个引用,内容如下: foreach $j (@{$d->{AddMsgList}}) { use Data::Dumper; print "\$j ------------\n"; my $var= Dumper($j); # my $var=encode("gbk",decode("utf8","$var")); print $var; print "\n"; if ("$j->{MsgType}" == 1){ print "\$message is $j->{Content}\n"; print "\n"; $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 };
相关文章推荐
- iOS7中UIView的animateKeyframesWithDuration方法讲解
- SharePoint 开启网站匿名访问图文详解
- 【Android】3.12 兴趣点( POI)搜索功能
- 不自定义也可更改UITableViewCellSection背景颜色字体颜色
- 正则表达式语法
- iOS两个app之间跳转及其传值
- linux系统命令:yum和apt-get
- 工作中你肯定会有关于 Yii2 的小贴士用法,在下面评论分享出来吧。
- Sqlite3 批量插入
- 工厂模式
- android 入门 001 (界面布局)
- 基于WindowsSDK检测游戏手柄
- const, static, inline函数在类外定义时注意点讨论
- ZwReadFile routine
- SQL Server中的三种物理连接操作
- 如何使用ping和tracert命令测试网站访问速度
- 4.1class文件结构
- tail 命令
- CENTOS下Python 升级后YUM无法使用的解决办法
- Unity中使用Protobuf-net