Search code examples
phphtmldata-transferdata-transfer-process

How to show content that changing time-to-time on a HTML Document


I want to show content that changing (Updating) time to time. For an example, Show Stack Overflow's Recent Questions. It changes within seconds sometimes. To do this, Should i go to website everytime, Copy code from source page and paste it on my document? It is very bad method and can't do this everytime. Have their a Easy way to show the content correctly without copy/pasting or showing in a I-frame. Also i want to include the questions into document without sidebar or navigation and with only questions, authors, times, other importants and SO logo on top.

<HTML>
<BODY>
<i class="fa fa-stack-overflow" id="logo">
<h1>Stack Overflow - Latest Questions</h1>
.... What should include? ....
</BODY>
</HTML>

What is the Most Easiest Way to do this? If the question is difficult to understand or Want more details, Please comment before down-voting! Thank You!


Solution

  • It depends on the website for which you're wanting to do this. If they have an API, like in your example (SO has an API), then you should use that.

    Probably you would want to call that website's API on your server, and then periodically call your server's API to get the most recent data from the site you're interested.