the code is here but i also have included it below in this post...
this post contains code see it here
its easy to pull data from the other APIs but its sometimes hard to find the correct service string tp pass so heres my cheat sheet. im all for helping / suggestions so please leve your comments they are always appreciated (and so are links)
| Google API | Service name |
|---|---|
| Google Analytics Data APIs | analytics |
| Google Apps Provisioning APIs | apps |
| Google Base Data API | gbase |
| Google Sites Data API | jotspot |
| Blogger Data API | blogger |
| Book Search Data API | print |
| Calendar Data API | cl |
| Google Code Search Data API | codesearch |
| Contacts Data API | cp |
| Documents List Data API | writely |
| Finance Data API | finance |
| Gmail Atom feed | mail |
| Health Data API | healthweaver |
| Maps Data APIs | local |
| Picasa Web Albums Data API | lh2 |
| Sidewiki Data API | annotateweb |
| Spreadsheets Data API | wise |
| Webmaster Tools API | sitemaps |
| YouTube Data API | youtube |
thanks for reading and i hope this helps you do more with the data APIs and get to your data more easily...
12 remarks:
Do you know how to do this in .net? I'm unfamiliar with the types invovled to do this and i wanted to know if you could shed any light on that.
Thanks!
i haven't used it myself but i would look into the GData .net library
hmm; very interesting, thank you for providing that.
Hi, Can you please tell me how I can parse and display this?
var spamsites = {sites:[{site:"20102010",visits:53118},{site:"20092009",visits:183311},{site:"20082008",visits:149735},{site:"20072007",visits:81522},{site:"20062006",visits:27195}],totalhits:494881}
if you want the data directly thats what these are entitys(i).getElementsByTagName("dxp:metric")(0).getAttribute("value")
i designed this code so i can display it with javascript so "spamsites" is a JSON object you add a <script> pointed to that asp file
then you can address the data like document.write(spamsites.sites[0].site + ' had ' + spamsites.sites[0].visits) using javascript
Hi Carter ... code looks great re: consuming Google Analytics via ASP - got it set up on a test server, but getting a 403 error on the authentication as Google requires a CAPTCHA to be responded to. This obviously involves a pair or eyeballs, so did you find a way around that, or is your code "pre" CAPTCHA? Cheers, Reece.
never had that issue... the data api may have chnaged, or had to many connects making it think you were a bot... i use this in a few other places and it hasnt failed so im not sure
Hi Carter,
Sorry if this is a stupid question but you say "unfortunately i haven't found a good asp oauth" - does this mean I'll have to sort out an oauth script to get the above working?
Thanks for sharing!
Bob
Nope! it just uses the password straight in the code and doesnt bother with trying to use oauth
check this:
http://scottdesapio.com/VBScriptOAuth/
@Iticket: You should check the line with test.url= "https..." you should replace the ids=ga:XXXXX with your own profile ID.
Post a Comment
Link to this post if you found it usefull