Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Read and display Twitter directly with Smarty 3.17

 
Post new topic   Reply to topic    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
jacz
Smarty Pro


Joined: 13 Nov 2010
Posts: 249

PostPosted: Fri Jan 13, 2012 7:44 pm    Post subject: Read and display Twitter directly with Smarty 3.17 Reply with quote

Very simple code
Code:

{$twitter=simplexml_load_file('http://www.twitter.com/status/user_timeline/google.xml')}
{foreach $twitter as $tweet}
<p>Tweet from User {$tweet->user->screen_name} on {$tweet->created_at}<br/>{$tweet->text}</p>
{/foreach}


Change google to the screenname you wish and it works.
Back to top
View user's profile Send private message Visit poster's website
DiscoInferno
Smarty Rookie


Joined: 09 Aug 2011
Posts: 20
Location: Moscow, Russia.

PostPosted: Tue Mar 13, 2012 7:30 pm    Post subject: Reply with quote

Cool.
Yep. Very useful thing.
Thanx man.
Back to top
View user's profile Send private message Visit poster's website
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 420
Location: Kathmandu, Nepal

PostPosted: Wed Mar 14, 2012 9:47 am    Post subject: No JSON Reply with quote

Thanks - helps me a lot.
No JSON parser, no PHP codes.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP