zoukankan      html  css  js  c++  java
  • php采集淘宝店的评论,php采集淘宝店铺的所有评论的实现

    采集淘宝店的所有评论,在之前的博文中我已经介绍了淘宝店铺评论的URL规则,也相当于是采集淘宝评论的接口;

    在这里讨论,用php怎么来具体得去实现采集淘宝店铺所有评论的功能;

    在这里拿userid=46292644的做举例:http://rate.taobao.com/user-rate-46292644.htm

    有需求请联系QQ:10064409889,转载请注明来源:http://www.cnblogs.com/wangtongphp/archive/2013/05/11/3072901.html

    获取到json转化为数组之后,对应上图的数组如下:

     [3]=>
        array(27) {
          ["XID"]=>
          string(0) ""
          ["append"]=>
          NULL
          ["auction"]=>
          array(7) {
            ["XID"]=>
            string(0) ""
            ["aucNumId"]=>
            string(11) "14133309210"
            ["auctionPrice"]=>
            int(90)
            ["link"]=>
            string(76) "http://trade.taobao.com/trade/detail/trade_snap.htm?trade_id=248967312362665"
            ["sku"]=>
            string(49) "颜色:马尔代夫 红格 &nbsp尺码:170/M"
            ["thumbnail"]=>
            string(0) ""
            ["title"]=>
            string(88) "2013夏装新款男装格子短袖衬衫潮男韩版修身短袖衬衣休闲上衣服男"
          }
          ["award"]=>
          string(0) ""
          ["bidPriceMoney"]=>
          array(6) {
            ["amount"]=>
            int(50)
            ["cent"]=>
            int(5000)
            ["centFactor"]=>
            int(100)
            ["currency"]=>
            array(3) {
              ["currencyCode"]=>
              string(3) "CNY"
              ["defaultFractionDigits"]=>
              int(2)
              ["symbol"]=>
              string(3) "¥"
            }
            ["currencyCode"]=>
            string(3) "CNY"
            ["displayUnit"]=>
            string(3) "元"
          }
          ["buyAmount"]=>
          int(1)
          ["content"]=>
          string(9) "大爱。"
          ["date"]=>
          string(23) "2013年05月11日 16:01"
          ["enableSNS"]=>
          bool(false)
          ["from"]=>
          string(0) ""
          ["payTime"]=>
          array(9) {
            ["date"]=>
            int(20)
            ["day"]=>
            int(6)
            ["hours"]=>
            int(13)
            ["minutes"]=>
            int(11)
            ["month"]=>
            int(3)
            ["seconds"]=>
            int(48)
            ["time"]=>
            float(1.366434708E+12)
            ["timezoneOffset"]=>
            int(-480)
            ["year"]=>
            int(113)
          }
          ["photos"]=>
          array(0) {
          }
          ["promotionType"]=>
          string(14) "活动促销  "
          ["propertiesAvg"]=>
          string(3) "0.0"
          ["rate"]=>
          string(1) "1"
          ["rateId"]=>
          float(65014637437)
          ["raterType"]=>
          int(0)
          ["reply"]=>
          NULL
          ["shareInfo"]=>
          array(6) {
            ["XID"]=>
            string(0) ""
            ["lastReplyTime"]=>
            string(0) ""
            ["pic"]=>
            int(0)
            ["reply"]=>
            int(0)
            ["share"]=>
            bool(false)
            ["userNumIdBase64"]=>
            string(0) ""
          }
          ["showCuIcon"]=>
          bool(true)
          ["showDepositIcon"]=>
          bool(false)
          ["spuRatting"]=>
          array(0) {
          }
          ["tag"]=>
          string(0) ""
          ["tradeId"]=>
          string(15) "248967312362665"
          ["useful"]=>
          int(0)
          ["user"]=>
          array(10) {
            ["anony"]=>
            bool(false)
            ["avatar"]=>
            string(90) "http://wwc.taobaocdn.com/avatar/getAvatar.do?userId=1669296526&width=40&height=40&type=sns"
            ["displayRatePic"]=>
            string(11) "b_red_1.gif"
            ["nick"]=>
            string(11) "ll841075813"
            ["nickUrl"]=>
            string(70) "http://i.taobao.com/u/MTY2OTI5NjUyNg==/tlive/taodan_list.htm?from=rate"
            ["rank"]=>
            int(4)
            ["rankUrl"]=>
            string(58) "http://rate.taobao.com/rate.htm?user_id=1669296526&rater=1"
            ["userId"]=>
            int(1669296526)
            ["vip"]=>
            string(0) ""
            ["vipLevel"]=>
            int(0)
          }
          ["validscore"]=>
          int(1)
        }
     [9]=>
        array(27) {
          ["XID"]=>
          string(0) ""
          ["append"]=>
          NULL
          ["auction"]=>
          array(7) {
            ["XID"]=>
            string(0) ""
            ["aucNumId"]=>
            string(11) "16117225817"
            ["auctionPrice"]=>
            int(125)
            ["link"]=>
            string(76) "http://trade.taobao.com/trade/detail/trade_snap.htm?trade_id=341523927809673"
            ["sku"]=>
            string(72) "颜色:C款巴黎塔浅灰 &nbsp尺码:L[100%棉不褪色不起球]"
            ["thumbnail"]=>
            string(0) ""
            ["title"]=>
            string(86) "2013春装新款男士修身长袖t恤韩版纯棉小衫体恤男装打底衫上衣服"
          }
          ["award"]=>
          string(0) ""
          ["bidPriceMoney"]=>
          array(6) {
            ["amount"]=>
            int(49)
            ["cent"]=>
            int(4900)
            ["centFactor"]=>
            int(100)
            ["currency"]=>
            array(3) {
              ["currencyCode"]=>
              string(3) "CNY"
              ["defaultFractionDigits"]=>
              int(2)
              ["symbol"]=>
              string(3) "¥"
            }
            ["currencyCode"]=>
            string(3) "CNY"
            ["displayUnit"]=>
            string(3) "元"
          }
          ["buyAmount"]=>
          int(1)
          ["content"]=>
          string(72) "面料还可以,老公还没试,我就拿去洗了,应该可以。"
          ["date"]=>
          string(23) "2013年05月11日 15:10"
          ["enableSNS"]=>
          bool(false)
          ["from"]=>
          string(0) ""
          ["payTime"]=>
          array(9) {
            ["date"]=>
            int(7)
            ["day"]=>
            int(2)
            ["hours"]=>
            int(14)
            ["minutes"]=>
            int(34)
            ["month"]=>
            int(4)
            ["seconds"]=>
            int(36)
            ["time"]=>
            float(1.367908476E+12)
            ["timezoneOffset"]=>
            int(-480)
            ["year"]=>
            int(113)
          }
          ["photos"]=>
          array(0) {
          }
          ["promotionType"]=>
          string(14) "活动促销  "
          ["propertiesAvg"]=>
          string(5) "102.5"
          ["rate"]=>
          string(1) "1"
          ["rateId"]=>
          float(65013741237)
          ["raterType"]=>
          int(0)
          ["reply"]=>
          NULL
          ["shareInfo"]=>
          array(6) {
            ["XID"]=>
            string(0) ""
            ["lastReplyTime"]=>
            string(0) ""
            ["pic"]=>
            int(0)
            ["reply"]=>
            int(0)
            ["share"]=>
            bool(false)
            ["userNumIdBase64"]=>
            string(0) ""
          }
          ["showCuIcon"]=>
          bool(true)
          ["showDepositIcon"]=>
          bool(false)
          ["spuRatting"]=>
          array(2) {
            [0]=>
            array(4) {
              ["XID"]=>
              string(0) ""
              ["desc"]=>
              string(8) "50公斤"
              ["name"]=>
              string(6) "体重"
              ["value"]=>
              string(2) "50"
            }
            [1]=>
            array(4) {
              ["XID"]=>
              string(0) ""
              ["desc"]=>
              string(9) "155厘米"
              ["name"]=>
              string(6) "身高"
              ["value"]=>
              string(3) "155"
            }
          }
          ["tag"]=>
          string(0) ""
          ["tradeId"]=>
          string(15) "341523927809673"
          ["useful"]=>
          int(0)
          ["user"]=>
          array(10) {
            ["anony"]=>
            bool(false)
            ["avatar"]=>
            string(89) "http://wwc.taobaocdn.com/avatar/getAvatar.do?userId=444157396&width=40&height=40&type=sns"
            ["displayRatePic"]=>
            string(12) "b_blue_1.gif"
            ["nick"]=>
            string(9) "细称砣"
            ["nickUrl"]=>
            string(66) "http://i.taobao.com/u/NDQ0MTU3Mzk2/tlive/taodan_list.htm?from=rate"
            ["rank"]=>
            int(328)
            ["rankUrl"]=>
            string(57) "http://rate.taobao.com/rate.htm?user_id=444157396&rater=1"
            ["userId"]=>
            int(444157396)
            ["vip"]=>
            string(0) ""
            ["vipLevel"]=>
            int(3)
          }
          ["validscore"]=>
          int(-4)
        }
  • 相关阅读:
    Git常用命令
    C++ 四种强制类型转换
    Linux系统日志及日志分析
    C/C++中的getline函数总结:
    标准C++中的string类的用法总结
    C++中map的基本操作和使用;
    一个C++类的注释:
    C++ 中宏的使用 --来自:http://blog.csdn.net/hgl868/article/details/7058906
    c++ 的vector
    c++强制类型转换:dynamic_cast、const_cast 、static_cast、reinterpret_cast
  • 原文地址:https://www.cnblogs.com/wangtongphp/p/3072901.html
Copyright © 2011-2022 走看看