willwill
willwill

Reputation: 1056

Updating Open Graph item

I'm making a web site that users can build their TV watch list. They can save how many episodes in a show have they watched.

As some shows may have over 200 episodes, pushing one event per one episode is not really feasible so I use only one event for a show.

How do I update the episodes count after the user have updated their data?

(User cannot watch the same show multiple times, so one show can only have one open graph event)

Upvotes: 2

Views: 134

Answers (1)

Ratul Saha
Ratul Saha

Reputation: 400

As I got it, you have two possibilities:

  1. If you want to update the open graph item real-time, you have to call one event per episode.
  2. If you are fine with updating later, you can use cookies or session variables to save the count of episodes per show and you can push the count to the open graph event in interval time. But you have to make sure if the user closes the browser suddenly, your counter does not get lost (you can use the window.onunload or similar jquery alternatives).

Upvotes: 1

Related Questions