0

I developed a proof of concept application that uses WebSocket to mimic the functionality of Facebook.

If on Facebook someone "likes" a picture, I see the notification on my page right away without me refreshing the page. Is this being done by WebSocket? What strategy is this adopting - pub/sub?

The application I developed is in Java and I came across Atmosphere Framework. I'm not sure which sample I should review from their vast list of examples on GitHub to accomplish what I'm trying to do.

st0le
  • 33,375
  • 8
  • 89
  • 89
birdy
  • 9,286
  • 24
  • 107
  • 171

1 Answers1

0

Without Facebook API, we'll have to find a certain way:

On a dedicated server, since you are not using Facebook API, I would use an auto refresher that refreshes the Facebook page every interval of time and put the number of likes in a database. Then, use AJAX on your website that communicates with a PHP file on server.

Alex
  • 1,639
  • 3
  • 18
  • 33
  • redundantly refreshing the page seems like a bad practice. Also, I'm not necessarily looking for a sample using facebook. But just the functionality that facebook uses... – birdy Mar 16 '13 at 17:40
  • ah sorry I misunderstood the question! Then you should be using ajax. Facebook uses Ajax. – Alex Mar 16 '13 at 17:42