For a few months now I have been playing around with some of the cool API’s listed at ProgrammableWeb. As fun as it is to use these web services it’s not fun trying to get your head around the Request/Response aspects of web http requests. When it comes to .NET and Web Services its is pretty simple because VisualStudio does most of the dirty work and gives you back a class to program against. But when it comes to PHP and Web Services you are pretty much on your own.
In this short hack I am doing to demonstrate how to make a Web Service request using REST.
More
I recently purchased the PHP Cookbook 2ed, which is by far the best PHP book for the novice user. One of the areas in PHP that I haven’t spent much time on is Database Access like getting rows from a table and binding them to an array or inserting a row and getting the new Primary key. Instead of really learning any of that I usually end up using what ever bits of code I find on the web and call it good. I have tried to read the Chapter on Databases in Programming PHP but I just can’t get into reading about database access theory and what not anymore. (I have no excuse but laziness.) Anyhow a few weeks back I was staring a new project and I need to access the database and of course the first thing I did was start digging around for some code examples I had downloaded and grab the data access code. Then I ran into a snag and decide to not be lazy so I cracked the Cookbook open to the Database section. After looking at the code examples a bit I noticed they were looking the other MySQL bits of code I’ve seen. So I flip to the beginning of the chapter and I start reading. It was the usual bla bla bla PDO bla. PDO? Oh Great. More stuff I have neglected to learn.
More
This is something I was working on a few weeks ago.
What this demonstrates is the ability to send a block of text to a web services and have that service responds with a list of tags. Just to spice this up a bit I add in some Ajax.
More
This hack will show you how to search Flickr using the phpFlickr class and display the results with links to a larger image and to the Flickr page.
This tip requires a bit of pre-configuration and setup which you can find here and here.
The code is very simple and those of you that have been working with the phpFlickr class this will be very easy.
More
The title says it all and that’s just we’re going to do. We’re going to create an Ajax enabled Flickr slideshow using the phpFlickr class.
You’ll want to have a look at this article: Using phpFlickr to Intergrate Flickr Photos on Your Own Site because this hack builds off of the referenced article.
See the working example here.
More
Over the past couple of weeks I have been working with the phpFlickr class that interfaces with the Flickr API. Integrating with Flickr is part of a side-project that I have going which is to create a single site to display del.icio.us links, Flickr photos, Google office docs and other social networking stuff.
Any how I stumbled upon the phpFlickr class and have been hacking away at a fully integrated photo site to display my Flickr photos. Now don’t get too excited because the photos I have are mostly just my daughter (Yes, to those of you with out kids this is a little weird but I assure you it’s perfectly normal).
As always I started out with a grand plan to write the ultimate howto guide to the phpFlickr class and so far it’s going well but I am reaching a point that it’s just too much information for me to cover. So as a compromise I am posting the source code with some instructions so that others can use the code and hack at it them selves.
More
If you want to have some cool rounded corners on your site but you don't want to go through the trouble of either creating the 4 rounded corner images then Nifty Corners is your answer.
See the search box above. I got the cool rounded corner effect with very little code.
*note - I've changed my theme again and I am not using NiftyCorners here. *
First I create the JavaScript link to the *.js file:
HTML:
-
<script type="text/javascript" src="http://gotfoo.org/js/niftycube.js"></script>
If you are using WordPress you will need to be sure that niftycube.js and niftycube.js are in the same directory as your template.
Next up is adding a window.onload event to the header.php and invoke the Nifty function by passing it a list of elements#id's to convert:
HTML:
-
-
window.onload=function(){
-
Nifty("p#searchbox,p#toplinks");
-
}
-
</script>
As you can see I am passing it a <p> tag it's respective id searchbox.
It's that easy!!