This website recently got a major rebuild; if you're missing something, let Lorna know.

    Tag: google


  1. Doing Google Custom Search via API


    I'm working on a project that uses a search engine to show images on a particular topic ... but I need my search to be localised since I'm in the UK and so "football" doesn't mean what a generic search engine thinks it means. Getting this working was MUCH harder than I expected, so here's a quick post on what I did so that I can remember for next time - and if this helps you as well, then great :)

    Read more

  2. Using OAuth2 for Google APIs with PHP


    I've been working on something recently where I'm pulling information from lots of places onto a dashboard. Each API has its own little quirks so I'm trying to write up the ones that weren't idiot-proof, mostly so I can refer back to them later when I need to maintain my system!

    I've written about Google and OAuth before, but that was OAuth v1.0, and they are introducing OAuth2 for their newer APIs; in this example I was identifying myself in order to use the Google Plus API (which turns out not to do anything you'd expect it to do, but that's a whole separate blog post!).

    Read more

  3. Google OAuth 403 Response


    I had an issue this week on a system which has been working fine for a while, but stopped fetching some data from google's user account API. I was getting a 403 response from the API, which seemed odd. Luckily I was logging OAuth::getLastResponse() to my error logs (this …

    Read more

  4. Book Review: The Developer's Guide to Social Programming


    Recently the nice folks at Addison Wesley sent me a review copy of "The Developer's Guide to Social Programming" by Mark Hawker (you can find it here on amazon). This is right up my street as I'm doing so much with with APIs, social and otherwise, at the moment and the book covers things I'm using such as OAuth and google's services.

    Read more

  5. Quick-Start Guide for Google Charts API


    Google Charts API is a nice, freely available tool for creating really good-looking graphs very painlessly. Don't be fooled by the "API" bit though, there is no need for advanced understanding of HTTP here - you generate most graphs just by adding parameters to a URL! In this post we'll take a look at a few different ways to generate charts.

    Read more

  6. OAuth Google API for Unregistered Applications


    It is pretty common when using OAuth for there to be a relationship between the provider and consumer; as a consumer you usually register with the provider to obtain a consumer key and consumer secret. Google's APIs however do not require this. It is recommended that you register your application …

    Read more

  7. Retrieving Data from Google Analytics API using PHP


    Recently I started playing with the google analytics API, looking at ways to bring analytics onto dashboards and generate simple reports from the data in there. Very shortly after I started to look at the API, I had working data retrieval, so I thought I'd share my experiences (and code!).

    Read more

  8. Google Analytics Accounts API


    I'm working with Google Analytics at the moment, to pull information about web traffic from analytics into another system. Google have excellent APIs and that makes this job much easier. I'm using pecl_oauth to authenticate users against their google accounts (see my post about using OAuth from PHP), but even after I have a valid google user, working out which analytics accounts they have access to and how to refer to them is a puzzle in itself, so I thought I'd share what I learned.These examples use pecl_http, since I have control of my platform and I find it easy to work with. I've tried to write this with explanations of the overall process in between the code snippets so hopefully this makes the process clear whether or not you will use exactly the same implementation.

    Read more

  9. Fetching Namespaced XML Elements With SimpleXML


    Recently I was working with some google APIs and needed to retrieve some namespaced elements from the result set. This confused me more than I expected it to so here's my code for the next time I need it (and if you use it too, then great!)

    I was reading from their analytics data feed API, this returns a few key fields and then multiple <entry> tags, each with namespaced children. The entry tags look something like:

    Read more