Gemer It API

Basics

Gemer it is a full featured URL service, that given a url it will take a url such as http://bonta-kun.net and shorten it to http://gemerit.com/2. There are additional functions for searching an un-gemering links described below.

Requirements

The API generally supports 3 formats for retrieving the URL data in: JSON, XML, and plain text.

These formats can requested in two ways depending on your preference either as a parameter provided to create.php (such as http://gemerit.php?format=JSON...) or as the extension for create (such as http://gemerit.json...), if no format is supplied the default HTML view will be used.

Gemer Commands

Create


The create command takes a url parameter. It must be supplied via GET or POST, and it should contain the url you desire to shorten.

Parameter Outline

format

Allowed values:

  • text
  • json
  • xml

url

This merely takes the URL, gemer it is supposed to shorten

Examples

In the interest of making all these links live, I've used GET parameters, but they would have worked just as well with POST parameters
Given Url Result
http://gemerit.com/create.php?format=text&url=http://bonta-kun.net http://gemerit.com/2
http://gemerit.com/create.text?url=http://bonta-kun.net http://gemerit.com/2
http://gemerit.com/create.php?format=json&url=http://bonta-kun.net { "urls": ["http://gemerit.com/2"] }
http://gemerit.com/create.json?url=http://bonta-kun.net { "urls": ["http://gemerit.com/2"] }
http://gemerit.com/create.php?format=xml&url=http://bonta-kun.net <URLs><URL>http://gemerit.com/2</URL></URLs>
http://gemerit.com/create.xml?url=http://bonta-kun.net <URLs><URL>http://gemerit.com/2</URL></URLs>

About


In progress... coming at a later point.

Search


The search command takes a searchTerm parameter. It must be supplied via GET or POST, and it should contain the search term you want to search for.

Parameter Outline

format

Allowed values:

  • rss
  • xml

searchTerm

This is the search term, it will search the url, title and ip address. It is wildcarded, but otherwise is not very intelligent.

Examples

In the interest of making all these links live, I've used GET parameters, but they would have worked just as well with POST parameters
Given Url Result
http://gemerit.com/search.php?format=xmlsearchTerm=thebontakun/4461003153 <results>
  <gemerLink>
    <title>Domobook on Flickr - Photo Sharing!</title>
    <shortUrl>http://gemerit.com/x1r2</shortUrl>
    <visits>1</visits>
    <creationDate>1271010712</creationDate>
    <longUrl>http://www.flickr.com/photos/thebontakun/4461003153/</longUrl>
  </gemerLink>
<results>
http://gemerit.com/create.xml?searchTerm=thebontakun/4461003153 <results>
  <gemerLink>
    <title>Domobook on Flickr - Photo Sharing!</title>
    <shortUrl>http://gemerit.com/x1r2</shortUrl>
    <visits>1</visits>
    <creationDate>1271010712</creationDate>
    <longUrl>http://www.flickr.com/photos/thebontakun/4461003153/</longUrl>
  </gemerLink>
<results>