0

I have a website with articles. When a user has authenticated an application and gone to an article, it posts that "X has read Y on Z" to their profile/timeline

This is all well and good but if they come back several times, this will happen several times but I just want it to be done once. Any ideas?

How do I check if a user has added something to the timeline already?

rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
pee2pee
  • 3,619
  • 7
  • 52
  • 133

1 Answers1

3

With a custom action, you can go into the advanced setting and make the action unique - which means it can only be posted against each object once.

If you attempt to post multiple actions on the same object, each subsequent request to the Graph API will result in an error and no action will be stored.

The built-in news.reads action already has this property enabled. On The Independent or The Guardian, you can only 'read' each article once.

There is currently no way via the API to see if a user has an . If you want to enforce this without using the uniqueness property described above, you need to store this on your own side, and make this check before you post to Facebook.

Simon Cross
  • 13,315
  • 3
  • 32
  • 26
  • Thanks - after reading around and messing around with the code, it seems I can't publish to a users profile/timeline so all-in-all, a pretty pointless exercise! – pee2pee Dec 05 '11 at 15:08