Facepy UNTIL parameter does not function

115 views Asked by At

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.

1

There are 1 answers

0
aldorath On BEST ANSWER

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.