Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

Adblock for Chrome

Just found that one of my top FF extensions is now on Chrome, Adblock. Not only cutting out the garbarge online but also the flash adverts which sends my MBP CPU temp right up

Comments Comments (2) | Print Print | Send Send | 1409 Views

My blog has moved

Please update your bookmarks and feeds for my site.

I now have a Mango Blog at:

http://www.andyjarrett.com/blog

Feed URL: http://feeds.feedburner.com/andyjarrett

Comments Comments (0) | Print Print | Send Send | 1195 Views

Gmail Contacts Data API access with ColdFusion

I've been looking at accessing the Gmail contact data via their API. This is the first draft of my findings and is no way the finished solution but it does what it says on the tin and returns the email address's from a users Gmail account contacts. Its actually quite simple to and we're going to do this in 2 CFM pages. We are going to be using the AuthSub method of registration
There are three levels of registration:
  1. Unregistered: Application is not recognized by Google. The Access Request page, which prompts your users to either grant or deny access for your application, displays this caution highlighted in yellow: "Non-registered, not secure. This website has not registered with Google. We recommend that you continue the process only if you trust this destination."
  2. Registered: Application is recognized by Google. The Access Request page displays this caution: "Registered, not secure. This website is registered with Google to make authorization requests, but has not been configured to send requests securely. We recommend you continue if you trust this destination."
  3. Registered with enhanced security: Registered applications with a security certificate on file can use secure tokens. The Access Request page displays this message: "Registered, secure. This website is registered with Google to make authorization requests."

As we are going to be using the first method of Unregistered the user will getting some simple/basic prompts:

  1. The first will be asking them to log in and letting them know that "A third party service is requesting permission to access your Google Account"
  2. Second an Access Request page which lets the user know WHAT we are doing

Once they have logged in and agreed Google will take you back to your site. The

I've put the index.cfm in a folder on the root called contacts. Below is the content for index.cfm read the comments for what each variable is doing. This is all taken from Googles API docs on AuthSub proxy authentication.

view plain print about
1<cfhttp url="https://www.google.com/accounts/AuthSubRequest" method="get" result="res">
2    <!--- Indicates that the application is requesting a token to access contacts feeds.
3                The scope string to use is http://www.google.com/m8/feeds/ (URL-encoded, of course). --->

4    <cfhttpparam name="scope" value="http://www.google.com/m8/feeds/" type="url" />
5
6    <!--- Indicates whether the token returned can be exchanged for a multi-use (session) token. --->
7    <cfhttpparam name="session" value="1" type="url" />
8
9    <!--- Indicates whether the client is requesting a secure token. --->
10    <cfhttpparam name="secure" value="0" type="url" />
11
12    <!--- The URL of the page that Google should redirect the user to after authentication. --->
13    <cfhttpparam name="next" value="http://localhost/contacts/getAddresses.cfm" type="url" />
14</cfhttp>
15
16<cfoutput>#res.filecontent#</cfoutput>

Our second page is getAddresses.cfm In the contacts folder

view plain print about
1<cfhttp url="http://www.google.com/m8/feeds/contacts/default/base" method="get">
2    <cfhttpparam type="header" name="Authorization" value="AuthSub token=#url.token#">
3    <!--- The maximum number of entries to return. If you want to receive all of the
4        contacts, rather than only the default maximum, you can specify a very large number
5        for max-results i.e. 9999 --->

6    <cfhttpparam type="url" name="max-results" value="25" />
7</cfhttp>
8
9<!--- Dump the results--->
10<cfdump var="#cfhttp.fileContent#">

In my example I am only returning 25 records (for speed mainly) but if you want to know more about returning records check out Google API docs on query params. Also in my example I just dump the records. If you want to get out the email addresses you can use the following snippet.

view plain print about
1<cfset myXmlDoc = xmlParse(cfhttp.fileContent)>
2
3<cfoutput>
4    <cfloop from="1" to="#arrayLen(myxmldoc['feed']['entry'])#" index="i">
5    #myxmldoc['feed']['entry'][i]['gd:email'].xmlAttributes.address#<br/>
6    </cfloop>
7</cfoutput>

There is still some work to do here but this is the bare bones and a starting point for anyone interested.

Comments Comments (1) | Print Print | Send Send | 3900 Views

Accessing Google IMAP if its not enabled yet

This post is really aimed at anyone who uses GMail or Google Apps outside of the states or does not have English(US) set up as their default language!

Yes that right, if you are waiting for the IMAP settings on your Google mail account check your language settings now. This is something I remember reading about ages ago ... in short the Gmail team roll out new features for the US first and they use your language settings as a guide! Subsequently I've just enabled this on my apps account and it appeared instantly

Comments Comments (3) | Print Print | Send Send | 2873 Views

Google reader out of beta

The Google reader is finally graduating out of labs.

We don't know how to tell you this, but it's time that we break up. It's just that we're different now. People can search. They can share what they read. They can even see trends about what they read, and how often they do it. There are all sorts of things we could do in the future to make feed reading awesome. And that means you just can't be around anymore..

It's been in beta now for around two years and since then it has beaten off every reader that I've used. Though I do still miss FeedDemon I just find Googles reader indispensable due to the fact it's online, quick, and has keyboard shortcuts. All of this means it competes well with the offline apps and for me wins.

Comments Comments (1) | Print Print | Send Send | 1975 Views

Google Reader adds Stats

Google have now added Trends(stats) to the Google RSS Reader.

You can view your trends at http://www.google.com/reader/view/?page=trends( Presuming that you are logged in)

You can find out more from the Google Reader Blog: I like big charts and I cannot lie

You can view:

  • Reading trends over a 30 day/time of day/day of week period
  • See which blog are active/inactive
  • Breakdown of blogs read/starred/shared
  • .. and more

Comments Comments (1) | Print Print | Send Send | 2578 Views

Gmail accounts for your domain

Google are beta testing the ability to have Gmail access to your Domain emails. It offers the 2Gb (nearly 3 according to my stats) Gmail account, Google Talk, Google Calendar, and a Control Panel to manage user accounts, aliases, mailing lists, and chat settings.

You have to own your domain for this, its not something Gmail will offer. While in the beta it is free, but it does mention a cost factor in the learn more which might suggest this could change? maybe for corporate/large users. Another nice feature is that you can also upload your company's logo for brand awareness as well.

https://www.google.com/hosted/

Found while looking over at Ray Camdens site, in the comments

Comments Comments (4) | Print Print | Send Send | 2619 Views

Google maps java app on your mobile

The other day we were stuck in a HUGE traffic jam in London. We just happened to be heading over to Earls Court in rush hour. Well with the taxi moving 2 metres in 10 minutes we decided to walk instead. We didn't know our way, but the London pedestrian is always willing to help contary to what some people say. Really though what I could of done with (except for heading off earlier to avoid the traffic) is Google maps. So as usual now that I don't need it I've found a J2ME program to stick on your mobile from Google to access their maps.

You'll need to check that your phone is compatible though my Sony Ericsson W810i wasn't on there it ran fine as it works with most Java-enabled (J2ME) mobile phone. The map actually works really well and you can see an online demo here. What is lacking at the moment is the ability to work with a GPS device, currently Google Maps doesn't use any GPS technology even if your phone has it. You can do all the usual maps functions like directions from a to b, find a Domino's pizza etc. So if you are an occasional traveller who can't be bothered to find out were they are going before hand this might be for you.

Comments Comments (9) | Print Print | Send Send | 9683 Views

Google Spreadsheet and GooOS

Well I got on to the limited testers for Google spreadsheets. I wanted to try it out as I have a few work related logs which I manage that go around with me on a pen drive, and I thought what better than to have a web based solution.

I've been testing it out this morning and so far its more advanced than I thought it would be. The usual functions are there; bold,underline, copy, paste, formulas, multiple worksheet support, and you can even upload(open) you current .xls and .csv files. It also allows you to download all worksheets in a .xls format or download a single sheet in .csv and .html. One other nice feature which I think Excel doesnt have is autosave!

Obviously you cannot use macros but this isnt too much of a worry for me as im a basic Excel user. Overall its a good complete (free) spreadsheet editor which also happens to be online, but this does come at a cost. The system seems sluggish which is probably the amout of Ajax they have running in the background with the amount of onscreen information. You also cannot reduce the font which proves annoying when you have a 15+ row sheet even on my 21" 1680x1050 monitor. It is possible to reduce the font using the browser but then you loose the text on the editor button so this doesnt really work but you can of course send Google feedback and suggestions.

Looking at it though does remind me of the GooOS posts back in 2004 especially as they have now acquired Writely (an online word processor) recently.

Overall for now I'm sticking to Excel and my pen drive and thats not because its a terrible service, having everything online is nice, and it will be the future, but if you need a document and your web connection is down, what you gonna do?

Comments Comments (8) | Print Print | Send Send | 4158 Views

CF meeting Caledar pod code

I've made available below the code to my CF Meeting Calendar Pod. Its very rough and uses inline CSS. It also uses uses Ray Camdens iCal CFC which you can get from his "My Tools" pod. You will need to put this in your /includes/pod/ folder along with the pod code.

view plain print about
1<cfsetting enablecfoutputonly=true>
2<cfprocessingdirective pageencoding="utf-8">
3<!---
4    Name : pod.cfmeetings.cfm
5    Author : Andy Jarrett
6    Created : May 26, 2006
7    Last Updated : May 30, 2006
8    History :
9    Purpose          : Displays a list of event from a iCal calendar. This uses Ray Camdens iCal CFC
10                                    which you can get from http://ray.camdenfamily.com/ "My Tools"    pod. You will
11                                    need to put this in your /includes/pod/ folder.
12    Todo                 : Remove inline CSS
13--->

14
15<!--- This links to the blog entry with details about the blog calendar --->
16<cfset title = '<a class="ical" href="http://www.andyjarrett.co.uk/andy/blog/index.cfm/2006/4/27/ColdFusion-Meeting-Calendar">CFEvents Dairy</a>' />

17
18<cfmodule template="../../tags/podlayout.cfm" title="#title#">
19
20<cfoutput>
21
22    <!--- Get the calendar --->
23    <cfhttp URL="http://www.google.com/calendar/ical/i5bekb7bdf56ubf67bqa711un8@group.calendar.google.com/public/basic"
24        method="get">

25    <cfset data = cfhttp.filecontent />
26    
27    <!--- Call Ray Camdens iCal get this from http://ray.camdenfamily.com/ "My Tools"    pod --->
28    <cfset ical = createObject("component","ical").init(data)>
29
30    <cfset results = ical.getEvents()>
31    
32    <div style="width:175px;height:150px;overflow:auto;font-family:sans-serif;font-size:10px;">
33        <!--- Time Zone Converter --->
34        <a href="http://www.timezoneconverter.com/" target="_blank">Timezone Converter</a><br/>
35        
36        <cfloop index="x" from="1" to="#arraylen(results)#">
37            <cfset eventData = results[x]>
38            <cfset startDate = ical.icalParseDateTime(eventData.dtstart.data)>
39            <cfif structKeyExists(eventData,"dtend")>
40                <cfset endDate = ical.icalParseDateTime(eventData.dtend.data)>
41            <cfelseif structKeyExists(eventData,"duration") and eventData.duration.data is not "P1D">
42                <cfset endDate = ical.icalParseDuration(eventData.duration.data,startdate)>
43            <cfelse>
44                <cfset enddate = startdate>
45            </cfif>
46            <div style="text-align:left;background-color:3F3F3F;    border:1px solid CCC;    border-width:0 0 1px 0;    font-weight:bold;    text-align:right;    width:155px;">
47                    #dateFormat(startDate,"dd-mmm-yy")# #timeFormat(startDate,'HH:MM')#<cfif dateFormat(startDate,"mm/dd/yy") neq dateFormat(endDate,"mm/dd/yy")> - #dateFormat(endDate,"mm/dd/yy")#</cfif> GMT
48            </div>
49            <div style="text-align:left;padding:0 0 10px 0;">
50                    #eventData.summary.data#<br/>
51                    <cfif structKeyExists(eventData,"location")>
52                        Where: <a href="javascript:alert('#eventData.location.data#')">click here</a></cfif>
53            </div>
54        </cfloop>
55    </div>
56    <a href="http://www.andyjarrett.co.uk/andy/blog/index.cfm/2006/4/27/ColdFusion-Meeting-Calendar">Learn more CFEvents</a>
57
58</cfoutput>

Comments Comments (0) | Print Print | Send Send | 2767 Views

More Entries

BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .