dongziche8030 2012-08-06 13:47
浏览 36

Google+ API:按日期获取用户活动

My task is to get user list activities to the certain date, or from a certain date up to the current date. Does Google+ API have methods which can help to solve my task. Or can you tell me which way to look for?

I tried to get limited amount of activities

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'https://www.googleapis.com/plus/v1/people/'.$user->getGoogleId().'/activities/public?key='.sfConfig::get('app_google_plus_api_key')
            .'&maxResults='.sfConfig::get('app_google_plus_max_result'));
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
        curl_setopt($ch, CURLOPT_USERAGENT, 'PHP Bot');
        $data = json_decode(curl_exec($ch));
        curl_close($ch);

then parse response and get necessary activities. But problem is that in this limited amount of activities may not contain necessary date because this activities are newer then that date. I'm sorry if I did not explain precisely enough. I'm not a native language speaker.

  • 写回答

1条回答 默认 最新

  • duanrou5680 2012-08-08 01:05
    关注

    The Google+ API does not currently support this. Activities are returned from the activities.list method in the same order that they are displayed on https://plus.google.com. This means that while the first pages contain newer activities, older activities may be bumped up.

    There is a feature request for this in the API's issue tracker. If you star the issue you will be notified when it is updated.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大