Skip to content

Instantly share code, notes, and snippets.

@funkatron
Created March 29, 2011 03:45

Revisions

  1. funkatron revised this gist Mar 29, 2011. 1 changed file with 21 additions and 0 deletions.
    21 changes: 21 additions & 0 deletions spaz_api_methods.txt
    Original file line number Diff line number Diff line change
    @@ -47,6 +47,21 @@ curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.json?redirect=1
    # }
    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)
    #
    # {
    @@ -56,6 +71,12 @@ curl -i http://api.getspaz.com/url/info.json?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)
    #
    # {
  2. funkatron revised this gist Mar 29, 2011. 1 changed file with 10 additions and 6 deletions.
    16 changes: 10 additions & 6 deletions spaz_api_methods.txt
    Original file line number Diff line number Diff line change
    @@ -4,12 +4,16 @@
    #
    # 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"}
    # :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
  3. funkatron revised this gist Mar 29, 2011. 2 changed files with 102 additions and 35 deletions.
    35 changes: 0 additions & 35 deletions spaz_api_methods.bash
    Original file line number Diff line number Diff line change
    @@ -1,35 +0,0 @@
    # 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
    curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.xml

    # redirect via 302 by adding ?redirect=1
    curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.json?redirect=1


    # get URL info
    curl -i http://api.getspaz.com/url/info.json?url=http://getspaz.com

    # extract the URL title (if exists)
    curl -i http://api.getspaz.com/url/title.json?url=http://getspaz.com

    # resolve a short URL (or any URL that redirects)
    curl -i http://api.getspaz.com/url/resolve.json?url=http://j.mp/spazwebosbeta

    # get current time (to check if local clock is wrong
    curl -i http://api.getspaz.com/time.json

    # get external ip
    curl -i http://api.getspaz.com/ip.json
    102 changes: 102 additions & 0 deletions spaz_api_methods.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,102 @@
    # 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

    # 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

    # 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
  4. funkatron revised this gist Mar 29, 2011. 1 changed file with 17 additions and 1 deletion.
    18 changes: 17 additions & 1 deletion spaz_api_methods.bash
    Original file line number Diff line number Diff line change
    @@ -16,4 +16,20 @@ curl -i http://api.getspaz.com/avatar/identi.ca/funkatron
    curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.xml

    # redirect via 302 by adding ?redirect=1
    curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.json?redirect=1
    curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.json?redirect=1


    # get URL info
    curl -i http://api.getspaz.com/url/info.json?url=http://getspaz.com

    # extract the URL title (if exists)
    curl -i http://api.getspaz.com/url/title.json?url=http://getspaz.com

    # resolve a short URL (or any URL that redirects)
    curl -i http://api.getspaz.com/url/resolve.json?url=http://j.mp/spazwebosbeta

    # get current time (to check if local clock is wrong
    curl -i http://api.getspaz.com/time.json

    # get external ip
    curl -i http://api.getspaz.com/ip.json
  5. funkatron renamed this gist Mar 29, 2011. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. funkatron renamed this gist Mar 29, 2011. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion spaz_avatar_services.txt → spaz_avatar_services.bash
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,19 @@
    # 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). JSON is default
    # :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
    curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.xml

    # redirect via 302 by adding ?redirect=1
    curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.json?redirect=1
  7. funkatron revised this gist Mar 29, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion spaz_avatar_services.txt
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    # :username is the username
    # :format is "json", "xml" or "js" (jsonp). JSON is default

    #returns
    # 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

  8. funkatron created this gist Mar 29, 2011.
    12 changes: 12 additions & 0 deletions spaz_avatar_services.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    # 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). 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

    # redirect via 302 by adding ?redirect=1
    curl -i http://api.getspaz.com/avatar/identi.ca/funkatron.json?redirect=1