i wanted to be able to use this again and style it to my liking (im just crazy about my html) so i created my own API to pull the badge and return its info as JSON. i tried to do this with YQL but they cache the requests so i had to do it from my server
so heres the super simple script and how to use it
the api is at
http://cartercole.com/dev/api/gtbadge.asp?tk=[appid]
first your going to need to create a badge... (that will let us query your status from a public location)
next you need to find your badge id. if this is the iframe url for the badge
http://www.google.com/talk/service/badge/Show?tk=z01q6amlqklsogqki1t3ujmofuerp8pbc7hi5vuc0e2pv30c5mrb1tnl3im146nnc3h8f0q19sbism61srg12t5f06guvhhbecj9cgk60i2gbv7sqjdqb18k4893trro8nmuccsbfluh362067l4svbhjgibaiodbh3d1n5e1&w=200&h=60 the bold part is the id (or the tk= parameter). thats the badge id you need to pass to the api as the tk= parameter :) along with the optional callback= parameter so result is returned as callback({Object}) so the script can be used as JSONP (see explanation here) heres an example of what it returns (including optional callback)you must be on main post to view code
thats about it but before one last thing ill do... heres a quick example of its use.
and heres that script live right here... (i tweaked it a bit for better output) if you have any questions then just click below im usually online :)
1 remarks:
hi,
sorry for my english.
I try to use your script but with my ID it returns only BAD TK CODE...
but the TK ID is copied from iframe script
for example:
http://cartercole.com/dev/api/gtbadge.asp?tk=z01q6amlqj7i2dk6n3gp5dbnn9u1i5gfupt0upshq1smgv6185p4qe4u0gtu7767h1b9716t2gbcbv22uauki9hs9iv5u5lc8p9j9ltcbufdj03fubd50dqc3412p0jirjrp4u555lpk8m4iqbvq6kkqv7q2pjthiht5reh6f9os2p7horjen6sl7lmqj5hjvugjtcga26sb1an01j0defiern9gigo5t1l7ev5e91qpcp4sqdhqsq
where is the problem? thanks
Post a Comment
Link to this post if you found it usefull