2

Does anybody know why the UNTIL function seems not to be working in Facepy?

Is the error with my code, with Facepy or with the Facebook API?

When I have the code using Facepy:

groupData = graph.get(gID + "/feed", page=True, retry=3, since=2015-11-01, until=2015-11-30)

I get back nothing in the responses. As soon as I remove the "until" I get many responses.

All help appreciated.

aldorath
  • 1,479
  • 1
  • 10
  • 8
  • 1
    Wrong date format in the until? – Mathemats Dec 17 '15 at 00:40
  • 1
    Does python really allow you to specify a date value that way? In most programming languages, `2015-11-01` would be considered a mathematical expression … – CBroe Dec 17 '15 at 19:04

1 Answers1

0

Okay, the suggestion in the comment is correct that the date format was incorrect. It should read:

import time
import datetime

sTime = datetime.date(year,11,1)
uTime = datetime.date(year,11,7)

sinceTime = time.mktime(sTime.timetuple())
untilTime = time.mktime(uTime.timetuple())

groupData = graph.get(gID + "/feed", page=True, retry=3, since=sinceTime, until=untilTime)

Once this is done then the request works fine as an example of querying Facebook using FacePy for group data with date restriction.

aldorath
  • 1,479
  • 1
  • 10
  • 8