PHP
  Home arrow PHP arrow Dynamic Twitter Signature Images with PHP
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Dynamic Twitter Signature Images with PHP
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 2
    2009-08-11


    Table of Contents:
  • Dynamic Twitter Signature Images with PHP
  • Building the class
  • Parsing the XML feed
  • Grabbing the avatar image

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Dynamic Twitter Signature Images with PHP
    ( Page 1 of 4 )

    Twitter is the latest and greatest craze in social networking sites. As such, many developers and businesses are using it as a marketing technique. Today we’re going to come up with a method for creating a dynamic signature image for forum posts and emails that will automatically load your Twitter feed and display your latest Twitter status. We’ll be using PHP to grab the content along with GD2 support to create the image.

    I’m going to be presenting the code in this article in an object-oriented fashion using PHP 5.  If you’re not already using object-oriented programming techniques it’s important that you begin doing that.  You will be able to take advantage of more advanced features in PHP while building more robust applications.  In my opinion, it’s one of the subtle differences between a true programmer and a simple scripter.

    The first step in creating this project was determining what size to make the final image.  I considered the standard IAB ad unit sizes for banners, but they were either too big or too small for our purposes.  The 60 pixel height on a full banner (also called impact banner) was perfect, but a width of 480 pixels takes up a bit more real estate than I would like for a low profile signature image.  The half banner cuts that width in half, but then doesn’t allow much room for both a user’s avatar and text. 

    So I decided to shy away from a standard ad unit and compromise between the two, settling on a width of 380 pixels and a height of 60 pixels.  With this size a user’s avatar fits nicely inside the height and still allows about 300 pixels in width for the addition of text.  With the capacity to house four lines, this fits the Twitter status’ character length specification pretty nicely, as you can see in the live example below.

    Once I decided on a unit size for the image, I needed to build a background image that was the proper size.  This is a simple background that will provide a nice- looking backdrop for the image as opposed to having it over a single background color.  You can use Gimp or any other image creation software to create your own, or download the one I created in Photoshop here.



     
     
    >>> More PHP Articles          >>> More By Nilpo
     

       

    PHP ARTICLES

    - Adding Ordering and Grouping Clauses to the ...
    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek