4

I'm using django-facebook's Open Facebook API to try to defer a post with an image to a facebook page. The (relevant part of the) code is:

graph_api = OpenFacebook(integration.long_lived_page_token)
message = "something"
picture = "http://example.com/image.jpg"
d = datetime.datetime.strptime('07-25-2014 06:40 pm UTC', '%m-%d-%Y %I:%M %p %Z')
timestamp = timestamp = int(time.mktime(d.timetuple()))
try:
    facebook_response = graph_api.set('/{0}/feed'.format(
    facebook_page_id), message=message,
    link=picture, picture=picture,
    scheduled_publish_time=timestamp, published=0)
except:
...

This seems to work fine (I get the post id on facebook_response) but when the time comes to post this scheduled post nothing happens. When I check at the facebook page I see an error saying 'Sorry, something went wrong publishing this scheduled post' and offers to delete it or post it then. So, I can't seem to figure out what am I doing wrong. I found a similar question but it does not offer a good answer.

Oh, I forgot to say when I remove timestamp and published=0 parameters (i.e. I post on that exact moment), the post gets created and published on the page's feed.

Community
  • 1
  • 1
felix
  • 446
  • 5
  • 10
  • Hi. I have the same problem. Were you able to resolve it ?Did you app in dev mode to ? – mcbjam Apr 05 '15 at 13:26
  • I just used a celery job to look for scheduled posts every minute and post them. – felix Apr 06 '15 at 16:28
  • Hi Thanks for information. I make it work i'n not sure why. Maybe because and publish the application without any extra permissions. – mcbjam Apr 06 '15 at 18:47

0 Answers0