What's the best way to use the Twitter API via PHP?

前端 未结 6 1942
梦如初夏
梦如初夏 2021-01-12 16:58

A client would like me to add their Twitter stream to their website homepage, using a custom solution built in PHP.

The Twitter API obviously has a limited number of

6条回答
  •  梦毁少年i
    2021-01-12 17:23

    It will be quite easy, once you can pull down a timeline and display it, to then add some file-based-caching to it.

    check age of cache
    Is it more than 5 mins old?
        fetch the latest information
        regenerate the HTML for output
        save the finished HTML to disk
    display the cached pre-prepared HTML
    

    PEAR's Cache_Lite will do all you need on the caching layer.

提交回复
热议问题