当用户喜欢我的Facebook页面帖子时刮掉时间

时间:2018-01-24 13:54:03

标签: php python facebook facebook-graph-api

我找到了this Facebook scraper on GitHub,每个帖子都像一个Like_ID(类似的ID),person_hash_id(liker的哈希ID)和post_id(喜欢的帖子的ID)。

但是,我还想在我的Facebook页面上发生每次喜欢 时刮掉

也就是说,如果John Doe在 17h GMT 喜欢Post X,我也想抓取这些数据。

有没有办法确定(或至少猜测)喜欢来自喜欢ID的帖子?

还有其他方法吗?任何帮助(使用任何编程语言)将不胜感激。

2 个答案:

答案 0 :(得分:0)

通过Facebook Graph API,您可以看到您可以访问的所有字段。 我喜欢对虚拟组的评论,以向您显示所提供的所有信息:似乎您不能。

我认为正确的做法是每天或每小时检查一下每个人,并拥有一个像人类一样的人。。在那里,你会知道什么时候发布。

likes

答案 1 :(得分:0)

图谱API不允许您解析类似的时间,我认为您最好的选择是生成日期和时间并执行连续请求,例如每10分钟或1小时......等等,并在每次解析这些数据时指定日期和时间,它看起来像这样:

while True:
    #request Graph API for some data
    parse_time = datetime.utcnow() #parse time and date in UTC tz (since Graph API uses UTC) at the time of request
    #here you should create new table 'post_like_count' this table will contain 3 columns: post_id, likes_count, parse_date
    time.sleep(60*10) #sleep for 10 mins in order not to exceed Graph API limited number of requests