Show latest tweets - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Show latest tweets (/showthread.php?tid=23203) Pages:
1
2
|
Show latest tweets - El Forum - 10-05-2009 [eluser]Phil Sturgeon[/eluser] It can be done at a VERY basic level following the explanation and code examples in this article. That shows you how to show a users feed and even support full syntax using plain PHP - so adjust accordingly for CodeIgniter. It is obviously not the best method as it has no caching, no connection failure handling, etc but the point is to show how easy it can be to get a twitter feed on a page. :-) Show latest tweets - El Forum - 10-05-2009 [eluser]mvdg27[/eluser] Hi phill, I like your replacement code. There's one error in it though: Code: // Run all rules to replace syntax with HTML should be Code: // Run all rules to replace syntax with HTML ($replace should be $patterns) Can I use your code to combine it with my function? Show latest tweets - El Forum - 10-05-2009 [eluser]Phil Sturgeon[/eluser] No, if you try using the code I posted on my blog I will hunt you down like a dog. Actually... go for it. I am feeling kind today. :lol: Show latest tweets - El Forum - 10-05-2009 [eluser]mvdg27[/eluser] I'll take the risk of Phil changing his mind after all, and coming to hunt me down .. hehe Anyway, here is my latest version of the twitter function. I've added some functionality: - timeout for retrieving the Twitter feed from twitter.com, so you can prevent your website from becoming too slow when Twitter is too busy - parsing the Tweet text - an option to force clearing the cache Code: function twitter_feed($username = '', $max = 5, $cache_time = 3600, $timeout = 1, $clear_cache = false) { Let me know what you think of the code, and how it works in a production environment. Enjoy Michiel Show latest tweets - El Forum - 10-05-2009 [eluser]aryan_[/eluser] [quote author="Thollsten" date="1254740391"]I personally prefer to load the tweets on the client side, not on the server side. There are several nice jQuery Plugins for this issue, I use http://tweet.seaofclouds.com/. At the beginning of my project I displayed the tweets via SimplePie on my CI page, but the problem was, that there was a great impact on the loading time of my page if twitter had some problems. With the client side solution, the page renders fast and the tweets are easily loaded without any side effects after displaying my main content.[/quote] Interesting! I'll try it. Show latest tweets - El Forum - 10-05-2009 [eluser]aryan_[/eluser] Thanks a lot! I'm using Simplepie library to parse feed. |