News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
How to Create Your Own Twitter Widget in PHP, Part 2
January 06, 2011 @ 12:05:40

On the SitePoint PHP blog today Craig Buckler is back with the second part of their series on creating a Twitter widget for your site. You can find more about the first part of the series here.

In Part 1 of this series, we examined the Twitter API, creating a PHP TwitterStatus class, and imported the latest tweets in JSON format. Today, we'll populate the data into HTML templates - download the full source code here.

The templates are strings of HTML with tags for where the content belongs - in this case things like "{TWEETS}" and "{profile_image_url}". Regular expressions are used to parse the templates and a str_replace used to make the substitution. The final product is included showing a few example tweets with some parsed links inside each.

0 comments voice your opinion now!
twitter widget rest api tutorial series template


blog comments powered by Disqus

Similar Posts

DevShed: Working with Prepared Queries with PDO Objects in PHP 5

PHP-Tools Blog: Der Zauberlehrling - Sorcerer's Apprentice

Ben Ramsey's Blog: Funcaday.com Dashboard Widget

Brian Swan's Blog: How to Page Data with the SQL Server Drivers for PHP

Zend Developer Zone: Migrating applications from PHP 4 to Zend Core 2.5 w/support for IBM Informix


Community Events





Don't see your event here?
Let us know!


introduction interview community deployment voicesoftheelephpant symfony tips podcast install series list package library laravel api framework language bugfix release opinion

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework