Created
March 29, 2011 03:45
-
-
Save funkatron/891778 to your computer and use it in GitHub Desktop.
Simple docs for Spaz Web APIs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/funkatron/Spaz-Web-APIs | |
# | |
# Avatar methods | |
# | |
# basic structure | |
# http://api.getspaz.com/avatar/:service/:username.:format | |
# :service is currently "identi.ca" or "twitter.com" | |
# :username is the username | |
# :format is "json", "xml" or "js" (jsonp. sorta). JSON is default | |
# | |
# returns: | |
# { | |
# "url":"http:\/\/avatar.identi.ca\/11868-48-20090709144251.jpeg", | |
# "service":"identi.ca", | |
# "userid":"funkatron" | |
# } | |
curl -i http://api.getspaz.com/avatar/identi.ca/funkatron | |
# get as XML | |
# | |
# <?xml version="1.0"?> | |
# <response> | |
# <url>http://avatar.identi.ca/11868-48-20090709144251.jpeg</url> | |
# <service>identi.ca</service> | |
# <userid>funkatron</userid> | |
# </response> | |
curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.xml | |
# redirect via 302 by adding ?redirect=1 | |
# | |
# HTTP/1.1 302 Moved Temporarily | |
# Location: http://avatar.identi.ca/11868-48-20090709144251.jpeg | |
# | |
curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.json?redirect=1 | |
# get URL info | |
# | |
# { | |
# "resolved_url":"http:\/\/getspaz.com", | |
# "content_type":"text\/html; charset=UTF-8", | |
# "http_code":200, | |
# "filetime":-1, | |
# "download_content_length":0, | |
# "cached":true, | |
# "url":"http:\/\/getspaz.com" | |
# } | |
curl -i http://api.getspaz.com/url/info.json?url=http://getspaz.com | |
# non-html url info | |
# | |
# { | |
# "resolved_url":"http:\/\/i.imgur.com\/uV6R0.gif", | |
# "content_type":"image\/gif", | |
# "http_code":200, | |
# "filetime":1300676920, | |
# "download_content_length":1933540, | |
# "cached":true, | |
# "url":"http:\/\/i.imgur.com\/uV6R0.gif" | |
# } | |
curl -i http://api.getspaz.com/url/title?url=http://i.imgur.com/uV6R0.gif | |
# extract the URL title (if exists) | |
# | |
# { | |
# "title":"Spaz: A Twitter, Identi.ca and StatusNet client for Palm\u00ae Pre\u2122, Windows, Mac OS X and Linux", | |
# "cached":false, | |
# "url":"http:\/\/getspaz.com" | |
# } | |
curl -i http://api.getspaz.com/url/title.json?url=http://getspaz.com | |
# non-html "title" resolution | |
# | |
# {"title":"image\/gif 1.84 MB","url":"http:\/\/i.imgur.com\/uV6R0.gif"} | |
curl -i http://api.getspaz.com/url/title?url=http://i.imgur.com/uV6R0.gif | |
# resolve a short URL (or any URL that redirects) | |
# | |
# { | |
# "passed_url":"http:\/\/j.mp\/spazwebosbeta", | |
# "redirects":1, | |
# "final_url":"http:\/\/developer.palm.com\/appredirect\/?packageid=com.funkatron.app.spaz-beta&applicationid=4928", | |
# "cached":true, | |
# "url":"http:\/\/j.mp\/spazwebosbeta" | |
# } | |
curl -i http://api.getspaz.com/url/resolve.json?url=http://j.mp/spazwebosbeta | |
# get current time (to check if local clock is wrong) | |
# (this proxies http://json-time.appspot.com/ for now) | |
# | |
# { | |
# "time": | |
# { | |
# "tz":"UTC", | |
# "hour":17, | |
# "datetime":"Tue, | |
# 29 Mar 2011 17:22:21 +0000", | |
# "second":21, | |
# "error":false, | |
# "minute":22 | |
# } | |
# } | |
curl -i http://api.getspaz.com/time.json | |
# with timezone | |
# | |
# { | |
# "time": | |
# { | |
# "tz":"America\/Indianapolis", | |
# "hour":13, | |
# "datetime":"Tue, | |
# 29 Mar 2011 13:22:47 -0400", | |
# "second":47, | |
# "error":false, | |
# "minute":22 | |
# } | |
# } | |
curl -i http://api.getspaz.com/time.json?tz=America/Indianapolis | |
# get external ip | |
# | |
# {"ip":"98.253.74.34"} | |
curl -i http://api.getspaz.com/ip.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment