0

Researching this topic took me a long time, mainly because of my lack of knowledge of how RSS actually works, I understand that generating RSS is basically generating an XML file with multiple items each of which have its' own title and description..etc.and then we can display these items on the front-end.

I am asking the question above to prevent overthinking or overworking the problem, I am not sure if websites like Facebook and LinkedIn use the RSS approach described above or even if they use RSS at all.

Whatever the correct approach may be, I know that this problem have two branches, one is the generation of the news feed in the back-end with MySQL and Java, and the second involves displaying them correctly which most likely is done using jQuery.

Any suggestion of how to approach this problem is appreciated.

aero
  • 107
  • 4

1 Answers1

2

RSS is a specification format for feeds. As you said, it's just a specification of an XML document. Since RSS is a specified format, there are many tools that can digest RSS feeds. It only makes sense to use RSS if you want to allow integrations with those tools. I've never personally added RSS feeds to my API because it doesn't really matter to me, and I think RSS has already lost enough popularity that it's not worth supporting.

Several major sites such as Facebook and Twitter previously offered RSS feeds but have reduced or removed support. Additionally, widely used readers such as Shiira, FeedDemon, and Google Reader have been discontinued having cited declining popularity in RSS. RSS support was removed in OS X Mountain Lion's versions of Mail and Safari... - Wikipedia

Unless your requirements dictate support for RSS readers, I would recommend not spending the extra effort to support them on both client and server side.

I would recommend using a format that best supports your use case. For example if you were supporting mobile or embedded devices, you might decide to use a compact binary format that would be light on bandwidth. In your specific case, you're asking about integration with a JavaScript web client, so the obvious choice of serialization format is JSON. You can return a JSON array of objects:

[
  {
    "title": "Feed item 1",
    "description": "Lorem ipsum",
    "image": "http://example.com/logo.png"
  },
  {
    "title": "Feed item 2"
  }
]
Samuel
  • 9,137
  • 1
  • 25
  • 42
  • 2
    That make sense, since iam already using Ajax to send and receive JSON data, i guess i can apply the samething to user's posts, what I can do is having a queue of news feed in the backend already fetched and preprocessed and just waiting there, then when the user scroll down, ajax will send a request to get the next post JSON data in the queue and the sever reply with that data. thanks alot, that's much better, can't upvote your answer, my reputation not enough yet. – aero Jul 30 '17 at 23:36