News Feed
Sections




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

Ben Ramsey's Blog:
Create an Image from XML Data
May 19, 2006 @ 05:50:53

In the ever-continuing work that he's been doing with SimpleXML lately, Ben Ramsey shares a new bit of code

It's not really a "problem," but FeedBurner's FeedCount image is a rigid 88 pixels wide, and I wanted to include it on my homepage under the "syndicate" heading, an area that I've defined in my template as having only 80 pixels in width. The 88 pixels were throwing things off, so I used the width attribute of the HTML img tag to solve the problem. Unfortunately, it just squeezes the image, making the text in it appear fuzzy.

FeedBurner conveniently provides what they call their "Awareness API," which is a RESTful interface to retrieve (as XML data) the same exact information displayed in the FeedCountTM image. I simply fired up an image editing program, shuffled things around a bit until the image was a nice, clean 80 pixels wide, and saved it as the base image (shown to the right) I would use for generating an image similar to the one FeedBurner provides.

He explains what the script does via the SimpleXML call and gives the code to accomplish it. It's a short bit of code, but quite powerful when combined with the API from Feedburner - grabbing the data from a local image and integrating the text response from the API. It's great that they have that too - definitely a wise move to allow users even more flexibility in integration for their site.

0 comments voice your opinion now!
image create simplexml feedburner api rest awareness image create simplexml feedburner api rest awareness


blog comments powered by Disqus

Similar Posts

Geshan Manandhar: 3 Bundles to get started with REST in Symfony 2 and some tips

Webhole.net: Best Buy Search API Tutorial

Community News: Apigility 1.0.0beta1 Released!

Matthew Weier O'Phinney's Blog: Responding to Different Content Types in RESTful ZF Apps

Satish Gopal's Blog: Building RESTful services - part 2


Community Events

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


extension list introduction version podcast api interview unittest php7 voicesoftheelephpant framework community laravel5 opinion laravel example library language release series

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