 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Zend Developer Zone: Consuming WebThumb's API in PHP
by Chris Cornutt October 17, 2006 @ 13:57:19
On the Zend Developer Zone today, there's a tutorial put together by Cal Evans showing how to use the WebThumb API via a PHP 5 script.
It's a simple service on the surface. You hand it a URL, it gives you back a thumbnail of that web site. At first glance you may think..."ok, why?" The answer to that is of course, "it depends".
He gives examples of reasons it would be needed (designers wanting to show off screenshots of a site or a replacement for Alexa's thumbnailing service) and the code that is needed to make things work. The script asks for the three properties the API needs - a URL for the target site, the height of the browser "window" taking the shot, and the width of this same "window".
Cal show examples of the messages sent back and forth and includes the code for the PHP 5 class to make the request along with some sample usage code. The class makes a basic HTTP request to the API with the XML payload and waits for the response - an estimate of the time for the job and the URL that the results can be found at.
voice your opinion now!
webthumb consuming xml web service api thumbnail php5 webthumb consuming xml web service api thumbnail php5
Joshua Eichorn's Blog: Webthumb API additions
by Chris Cornutt October 02, 2006 @ 16:13:01
In light of the popularity of his WebThumb site thumbnailing service, Joshua Eichorn is implementing a new feature to help reduce the number of requests to the server. The most popular request is made to see if a thumbnail is ready, and the new feature - a GET callback to the server making the request - will help to reduce them.
If you wondered an API that requires polling isn't a very good thing for scalability. On my current setup I can pretty easily handle about 20 status requests per second on top of my normal traffic, the problem is its not hard for a bad polling implmentation being run by one user to make that many requests.
To solve this problem im adding an addition to the Webthumb API that will allow you to skip polling all together. The basic idea is that your make an API request and when your thumbnail is complete i'll make a GET request back too your server telling you that the request is complete.
It's a simple matter of including a new "notify" tag in the XML message to the server with a URL to make the callback to. He even includes some sample PHP code to get you started with the new feature. The script handles the automatic download of the thumbnails when called from the WebThumb service.
voice your opinion now!
webthumb api callback notify message sample webthumb api callback notify message sample
Hasin Hayder's Blog: Creating Thumbnail of WebPages using WebThumb API
by Chris Cornutt September 06, 2006 @ 06:15:15
From Hasin Hayder's blog, there's a new tutorial demonstrating how to use the newly released WebThumb API from Joshua Eichorn to create thumbnails of websites dynamically.
Using WebThumb API, you can generate a thumbnail in three steps. First you have to place a request containing the URL. As soon as your request is successful, WebThumb store your request in queue. That means you are not getting the thumbnail instantly (well, there are other factors also. to fetch an url requires time, so it is not possible to generate the thumbnail in real time).
In second step you have to check whether your thumbnail has been generated or it is still in the queue. If you get a green signal, you will proceed to the third step where you have to request a download URL of your thumbnails.
He shows how to make a request to the API, check how your request is doing (status), and grabbing the thumbnail it's generated. Then, it's on to the code, and a complete PHP script (using cURL) to make the complete request to the API, including waiting for the image to be finished to grab it.
voice your opinion now!
webthumb api thumbnail webpage dynamic curl tutorial webthumb api thumbnail webpage dynamic curl tutorial
Joshua Eichorn's Blog: Adding AJAX to a website step by step
by Chris Cornutt August 08, 2006 @ 11:59:44
Joshua Eichorn has posted this new tutorial to his site today, a detailed look at how to add Ajax to just about any site out there with the help of the HTML_AJAX PEAR package.
When looking at a adding AJAX you have a couple decisions you'll want to make up front. One is what tools your going to use. In the webthumb case thats pretty easy. Webthumb is a simple PHP app and doesn't use a framework, so I need a nice general PHP/AJAX framework that is easy to use, HTML_AJAX fits that need.
After picking my tools I need to decide what my goals are. My main focus will be to improve usability, but I also want to use AJAX to make the site seem a bit flashier, so its a bit of a technology demo too.
He uses his own current project, Webthumb as an illustration of his points including looks at remoting, a RequestStatus class, exporting a class with the HTML_AJAX package, and finally, making the Ajax calls.
voice your opinion now!
html_ajax add ajax webthumb remoting requeststatus html_ajax add ajax webthumb remoting requeststatus
|
Community Events
Don't see your event here? Let us know!
|