Developers > Reference guide to the REST API (advanced)
Reference guide to the REST API (advanced)
Introduction
LikeOrHate.com provides a REST-like API for those who want to customize results,
build mash-ups and so on.
You probably don't want to read this
page: we also provide a set of libraries
in several languages, which are much, much simpler to use. Most people don't need to know
about the REST internals, described in this page; they can just use those libraries.
This documentation covers the version 1.1beta1 of the API and
was last updated on March 1, 2010, 2:05 pm. Changes may occur to final 1.1
release, expected for March 15.
Overview
Have you read this important
information before anything else?
Important facts you have to know:
- Everything is encoded in UTF-8.
Requests must be in utf-8.
- Althouth we use http://sandbox.likeorhate.com as the base URI, that is only a
sandbox. Use the main site URI when you deploy
your code.
- Everything stored in LikeOrHate.com is a thing. Things can be subtyped. In OO-terms,
Thing is a parent class which may be inherited by subclasses. So users, lists and comments are things too.
This means you can use
thing/ requests with users, lists etc. The opposite is not true,
of course (that is, not all things are comments, but all comments are things).
- Prefer numeric ids to string labels. We suggest you query basic information with the label,
using disambiguation information to make sure you got the right thing, and then use only ids in
subsequent requests. Ids are permanent, you can safely use them in your own database.
- We limit the number requests per hour per IP. Check the current limits.
All requests are GET or POST. Methods that submit, change, or destroy data
require a POST, except for thing-rate, which is a write
operation which accepts both POST and GET. We return HTTP codes according to the
status of the request:
- 200 OK
- your request was perfect. We are glad to serve you data.
- 400 Bad Request
- your request was invalid. See the 'message' field to know what was wrong with it.
- 401 Not Authorized
- authentication was needed and either you didn't provide one or it was invalid.
- 403 Forbidden
- you have no permission for that request. 401 is returned when
authentication fails, while 403 is returned when authentication was ok but you still
have no permission for that request (for example, some user set his data as private or
you are trying to modify data that does not belong to you).
- 500 Internal Server Error
- damn, something went wrong in our servers.
Please tell us about it.
- 509 Bandwidth Limit Exceeded
- dude, you blew your
hourly limits. Wait for a few hours and we'll clear up your access.
And don't run those bad scripts anymore, ok?
REST URLs are in the following format:
http://likeorhate.com/rest/[service]/[function]/?[parameters]
Where:
- [service]
- This is the object you're seeking information on.
Possible values currently are: thing,
user, comment,
list, message,
search,
sparql,
and zeitgeist.
- [function]
- Which function of the service you want to run. See
the documentation for each service for a list of available functions.
- [parameters]
- Each function has its own parameters, but
some of the parameters are global. GET parameters
are ignored in POST requests, and vice-versa.
Global parameters
Some parameters are valid (but not necessarily meaningful) for all queries,
unless otherwise noted. They are:
- responseType
- Default is "XML".
Read more about available types.
- language
- Language for the request, according to BCP 47
(that is, RFC4646 and RFC4747, using Language Subtag Registry from IANA)
format (examples: "en", "en-us"). In write requests, sets the language
for the data being sent, although it can be overriden by other parameters.
In read requests, only entries matching that language will be returned
(if not set all languages are used).
- jsonvarout
- Used only when the responseType is
JSON (or a JSON variant). See below.
- jsoncallback
- Used only when the responseType is
JSON (or a JSON variant). See below.
These parameters are available for any request with a query that returns a
many items:
- total
- Integer, number of items returned per page. Default: 25. Maximum: 1000.
- begin
- Integer, result index to start at. First index is 0. Default: 0.
- sort
- Index to sort by. The available indices are listed at each function.
Response type
We support several formats for the response, to make life easier for the developer.
Some notes particular to each response type:
- XML
- UTF-8 encoded. We try to follow namespaces for popular
ontologies whenever we can. Contents of nodes are escaped, so you should unescape
them (although any decent XML reader should do this by default).
The base node is <likeorhate>, with the following attributes:
- version
- The API version. Equal major numbers (e.g. 1.0, 1.1, 1.2) are
completely backward compatible, but different major numbers (1.0, 2.0) may
introduce incompatibilities.
- status
- The return status. Boolean value: false means
something was wrong in your request, true means it was ok.
- message
- String explaining what went wrong, if status==false.
- HTML
- This is the very HTML we use in our own website and gadgets,
so it may suffer small changes from time to time, and even some big ones every
now and then. It's CSS-styled, so you can configure its look.
You should include the http://sandbox.likeorhate.com/css/loh_site.css stylesheet
(or roll your own), and some HTML code depends on our javascripts too, so you
should load http://sandbox.likeorhate.com/js/likeorhate.js.
We strongly suggest that you do not use HTML format in write
requests, since you are not always able to tell if the request was successful or
not; use JSONHTML instead.
We may drop support for HTML in write requests in the future, so you are warned.
- JSON
- JSON format. Use parameter "jsonvarout" to set the return
variable. That is, if
jsonvarout=foo, we output something like
var foo = {};. If you prefer to have a callback called instead of a variable
set, use instead the parameter "jsoncallback": if jsoncallback=foo, we output something like
foo();. Both jsonvarout and jsoncallback must validate against
^([a-zA-Z0-9\-_]*)$.
- JSONXML
- Same as XML, but wrapped in JSONP, so it can used in cross-site requests of javascript.
Use parameter "jsonvarout" to set your callback.
- JSONHTML
- Same as HTML, but wrapped in JSONP, so it can used in cross-site requests of javascript.
Use parameter "jsonvarout" to set your callback.
- PHP
- PHP serialization format. NOTE: since it is
more practical and interesting, we present in the examples of this documentation
the data AFTER it's run through
unserialize()!!! When you receive the raw data from the REST response, you have
to call unserialize() to parse it and get the results presented here.
- YAML
- YAML serialization format.
This documentation shows the response for several of the formats above. Note that
there may be small differences in the documentation from one format to another:
for example, requests which create things will have differing ids for each of
the responses, since we made separate requests to generate the output. With the
exception of HTML and JSONHTML, all the other formats should output the same
information.
- Integer/unsigned integer
- 32-bit integer.
- Float
- 32-bit float.
- Date
- Always in 'YYYY-MM-DD'.
- Time
- Always in 'HH:MM:SS'.
- Datetime
- Always in 'YYYY-MM-DD HH:MM:SS'.
- String
- In UTF-8, up to 256 characters (not bytes) long.
- Text
- In UTF-8, up to 16384 characters
(not bytes) long, but this length may increase in the future.
- HTML
- In UTF-8, up to 16384 characters
(not bytes) long, counting tags, but this length may increase in the future.
- URI
- A valid URI/URL. It will be normalized.
- Array
- An array. In an HTTP query, this looks like "item[]=1&item[]=2".
In responses, arrays in XML are delimited by an outer tag, usually the
<items> tag
(which may have a total attribute with the total items in the list (which may
be larger than the items actually rendered)). If the <items> tag is used,
individual items will be grouped by a <item> tag. Example:
<items total="30">
<item>
something
</item>
<item>
something2
</item>
</items>
- List
- A comma-delimited list of strings
- Fields
- Lists the fields that should be returned by the request. This is used
by requests that list many attributes, such as thing/editable/
and search/condition/.
This array must be JSON-encoded and is an associative array.
This array associates the field name to extra
parameters that control its appearance (these extra parameters are listed in each
command that supports fields). Here are examples in many languages of
the associative arrays (but REMEMBER, only JSON is accepted by the REST API!):
{"field1":{"value":"value field1","required":true},"field2":{"value":"value field1","comment":"Some comment"}}
array(
'field1' => array('value' => 'value field1', 'required' => true),
'field2' => array('value' => 'value field1', 'comment' => 'Some comment'),
);
{
'field1': {'value': 'value field1', 'required': true},
'field2': {'value': 'value field2', 'comment': 'Some comment'},
}
Authentication
Many requests require authentication, in particular write requests and
access to private data. We currently support these authentication schemes:
- HTTP Basic Authentication
- You should
know about it.
This is what you want to use if you want to access data only for your own user.
- Session cookies based authentication
- Session cookies, created by
a site login, are also accepted. The REST interface
does not provide a cookie login service by itself. This is more useful for
JavaScript.
- OAuth
- OAuth is
a common standard and may be used to access LikeOrHate by third parties on
behalf of other users, securely (three-legged OAuth).
You need to register
your application before you can use it. This is what you want if your site
will use LikeOrHate as a backend and you support user logins.
If you are using the REST API you must register for a
LikeOrHate user account using a local login, because we do not support login through
external sites, as we do in the website. Of course, regular users which are redirected to
LikeOrHate through OAuth will be able to login through external sites.
Grants
When accessing via OAuth, there are some fine-grained grant levels that the user
may use to control what the application can or cannot access. When you make an OAuth
request, the user will login and then agree or disagree with the list of grants that
you have selected.
- read
- read things
- create
- create things
- rate
- rate things
- update
- update things (attributes)
- delete
- delete things
- comment
- create comment
- media
- create/add media to an existing thing
- readMessage
- read private messages (inbox, outbox)
- writeMessage
- post private messages on user behalf
- readUser
- read user profile
- writeUser
- write user profile
Request reference
Thing command
This is the basic command to get information on the thing. Here you get
its id, rating, comments and more. Functions for the 'thing' command:
- base
- Basic data about the thing (overall ratings, statistics). Read-only
- information
- Information about the thing. Read-only.
- comment
- Get comments. Read-only.
- rate
- Thing rating. Write-only.
- related
- List of related things. Read-only.
- trackback
- List of trackbacks. Read-only.
- create
- Create a new thing. Write-only.
- setdata
- Sets or adds data (such as labels,
media, etc) for a thing. Write-only.
- editable
- Renders an editable interface to
create or edit a thing. Read-only.
The functions base, information, comment, related, trackback support multiple things in the
same request, so you can use arrays:
- label[]
- Array. May be present one or more times. Each one is a label of a
thing to be returned. '_' in labels which are not URIs are converted to spaces
before searching.
Search may return many possible things for a given label. In this case the best
match is returned, with a list of disambiguation possibilities.
- id[]
- Array. May be present one or more times. Each one is the internal
id used by LikeOrHate for a thing. Internal ids are handy (no way to mistake
two things which have the same or similar labels) but not user friendly.
You should prefer ids to labels whenever possible. Ids never
change (labels may), are faster and less error-prone.
thing/base: Basic data
This is the basic operation on LikeOrHate.com, which returns information on
a given thing. What is returned:
- id
- Integer. Used as a unique identifier for each thing. -1 means not found.
- querylabel
- String. The string label you sent as request, which may be somewhat
different than the returned labels (for example, case may mismatch).
- link
- URI. Link to this thing's page in LikeOrHate.com.
- thumb
- URI. A thumbnail, if it exists.
- created
- Datetime. Datetime when this thing was created.
- updated
- Datetime. Last datetime it was updated.
- like
- Unsigned integer. Number of "I like it" votes. Two other attributes may exist:
float
percent, with the percentage of votes calculated for you, and
float barwidth, which is used for the colored vote bars on
LikeOrHate.com.
- hate
- Integer. Number of "I hate it" votes. See like.
- whatever
- Integer. Number of "Whatever" votes. See like.
- average
- Float. A floating point grade for this thing, calculated from the
votes. 0 <= score <= 1, higher is more liked, smaller is more hated, 0.5 is
whatever.
- statistics
- Some statistics on this thing:
comment is the
number of comments, trackbackhits is the number of hits it got,
trackbackurl is the number of different URLs which has so far
linked to it, related the number of related things.
- disamb
- A list of possible disambiguations for this querylabel; the
id attribute gives the thing id.
Here's an example for the query: http://sandbox.likeorhate.com/rest/thing/base/?label[]=likeorhate.com:
<likeorhate status="true" version="1.1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:media="http://search.yahoo.com/mrss" xmlns:osoc="http://web-semantics.org/ns/opensocial" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xfn="http://gmpg.org/xfn/11#">
<items>
<item>
<thing>
<id>9</id>
<querylabel>likeorhate.com</querylabel>
<label xml:lang="en">LikeOrHate.com</label>
<link href="http://sandbox.likeorhate.com/thing/9/" rel="self" />
<thumb id="0" src="http://static.likeorhate.com/images/nopicture.png" />
<created>2010-03-01 14:04:37</created>
<updated>2010-03-01 14:04:37</updated>
<like barwidth="70" percent="100.0">1</like>
<whatever barwidth="0" percent="0.0">0</whatever>
<hate barwidth="0" percent="0.0">0</hate>
<average>0.640449438202247</average>
<statistics comment="2" related="" tbrating="0" trackbackhits="0" trackbackurl="0" />
<disamb>
<item id="9">LikeOrHate.com</item>
</disamb>
</thing>
</item>
</items>
</likeorhate>
<div class="roundedbox daylight" style=""> <div class="xhd">
<div class="xc"></div>
</div>
<div class="xbd">
<div class="xc2">
<div class="xs">
<div style="clear: both; height: 1px;"> </div>
<div about="http://sandbox.likeorhate.com/thing/9/" class="item loh_smallthing lohthing9">
<div class="title">
<a href="http://sandbox.likeorhate.com/thing/9/sandbox.likeorhate.com" property="dc:title" title="Click for more!">LikeOrHate.com</a>
</div>
<div class="thumb"><a thingid="9" href="http://sandbox.likeorhate.com/thing/9/sandbox.likeorhate.com"><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/images/nopicture.png" alt="" /><div class="thingthumb" mediaid="0" href="http://static.likeorhate.com/images/nopicture.png">More images</div></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="9"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="9"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=9&rate=like"
title="Do you like it? Click now and vote!" thingid="9">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="70" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">100.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="9"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=9&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="9">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="9"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=9&rate=hate"
title="Do you hate it? Click now and vote!" thingid="9">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
<div style="clear: both; height: 1px;"> </div>
</div>
</div>
</div>
<div class="xft">
<div class="xc3"></div>
</div>
</div>
{"version":"1.1","status":true,"message":"","data":{"base":{"9":{"id":"9","querylabel":"likeorhate.com","created":"2010-03-01 14:04:37","updated":"2010-03-01 14:04:37","link":"http:\/\/sandbox.likeorhate.com\/thing\/9\/","label":"LikeOrHate.com","like":{"barwidth":70,"percent":"100.0","rating":"1"},"whatever":{"barwidth":0,"percent":"0.0","rating":"0"},"hate":{"barwidth":0,"percent":"0.0","rating":"0"},"average":"0.640449438202247","statistics":{"related":0,"comment":"2","trackbackhits":"0","trackbackurl":"0","tbrating":"0"},"thumb":{"src":"http:\/\/static.likeorhate.com\/images\/nopicture.png","id":0}}}}}
array (
'version' => '1.1',
'status' => true,
'message' => '',
'data' =>
array (
'base' =>
array (
9 =>
array (
'id' => '9',
'querylabel' => 'likeorhate.com',
'created' => '2010-03-01 14:04:37',
'updated' => '2010-03-01 14:04:37',
'link' => 'http://sandbox.likeorhate.com/thing/9/',
'label' => 'LikeOrHate.com',
'like' =>
array (
'barwidth' => 70,
'percent' => '100.0',
'rating' => '1',
),
'whatever' =>
array (
'barwidth' => 0,
'percent' => '0.0',
'rating' => '0',
),
'hate' =>
array (
'barwidth' => 0,
'percent' => '0.0',
'rating' => '0',
),
'average' => '0.640449438202247',
'statistics' =>
array (
'related' => 0,
'comment' => '2',
'trackbackhits' => '0',
'trackbackurl' => '0',
'tbrating' => '0',
),
'thumb' =>
array (
'src' => 'http://static.likeorhate.com/images/nopicture.png',
'id' => 0,
),
),
),
),
)
This returns comments made on the thing. What is returned for each comment:
- id
- Integer. Used as a unique identifier for each comment.
- guid
- URI. This is the unique URI to this comment.
- thing
- Unsigned integer. The id of the thing this comment is about.
- parent
- Integer. Parent comment (if this is a reply). If no parent, then 0.
- replies
- Unsigned integer. Number of replies this comment has.
- author
- String. Author name. May be used to query users.
- authorLink
- URI. The author page in LikeOrHate.com.
- authorRate
- String. The rate (like, hate, whatever) given by the author to the thing this comment is about. May be null.
- pubDate
- Datetime the comment was published.
- title
- String. Comment title. May be null.
- message
- HTML. Message body. May contain (safe) HTML.
- from
- URI. Page from which this comment was posted from.
- link
- URI. This comment's link.
- created
- Datetime the comment was created.
- update
- Datetime the comment was last updated.
- like
- Unsigned integer. Number of like votes for this comment.
- whatever
- Unsigned integer. Number of whatever votes for this comment.
- hate
- Unsigned integer. Number of hate votes for this comment.
- average
- Float. Vote score.
Here's an example for the query: http://sandbox.likeorhate.com/rest/thing/comment/?label[]=likeorhate.com:
NOTE: THE RESPONSE FOR THIS COMMAND IS CURRENTLY UNSTABLE. It may be changed without further notice.
Extended information about this thing. This will be continously extended with new
information (keeping backward compatibility) and should follow common RDF ontologies
as close as possible. Information currently includes:
- labels
- Composite. Alternate labels for this thing, with the corresponding
language if available.
- lists
- Composite. Lists this thing belongs to.
- descriptions
- Composite. A short description of this thing, with the corresponding
language if available.
Here's an example for the query: http://sandbox.likeorhate.com/rest/thing/information/?label[]=likeorhate.com:
<likeorhate message="Thing does not exist" status="false" version="1.1" />
<p class="error">Error in request. Thing does not exist</p>
{"version":"1.1","status":false,"message":"Thing does not exist"}
array (
'version' => '1.1',
'status' => false,
'message' => 'Thing does not exist',
)
thing/rate: Rate (write-only)
Rate command. This command is write-only, and used to add a new rating to the thing.
It accepts both GET and POST requests (which makes life easier for third party sites
to get around AJAX restrictions). Parameters:
- id
- Integer. Thing id.
- rate
- String. One of these strings: "like", "whatever", "rate". Case sensitive.
Information similar to thing/base is returned.
Here's an example for the query (id=1, rate=like):
<likeorhate status="true" version="1.1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:media="http://search.yahoo.com/mrss" xmlns:osoc="http://web-semantics.org/ns/opensocial" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xfn="http://gmpg.org/xfn/11#">
<thing>
<id>1</id>
<querylabel>1</querylabel>
<label xml:lang="">likeorhate</label>
<link href="http://sandbox.likeorhate.com/user/likeorhate/" rel="self" />
<thumb id="0" src="http://static.likeorhate.com/images/nopicture.png" />
<created>2010-03-01 14:04:36</created>
<updated>2010-03-01 14:04:36</updated>
<like barwidth="70" percent="100.0">1</like>
<whatever barwidth="0" percent="0.0">0</whatever>
<hate barwidth="0" percent="0.0">0</hate>
<average>0.640449438202247</average>
<statistics comment="0" related="" tbrating="0" trackbackhits="0" trackbackurl="0" />
</thing>
</likeorhate>
<div class="roundedbox daylight" style=""> <div class="xhd">
<div class="xc"></div>
</div>
<div class="xbd">
<div class="xc2">
<div class="xs">
<div style="clear: both; height: 1px;"> </div>
<div about="http://sandbox.likeorhate.com/user/likeorhate/" class="item loh_smallthing lohthing1">
<div class="title">
<a href="http://sandbox.likeorhate.com/user/likeorhate/" property="dc:title" title="Click for more!">likeorhate</a>
</div>
<div class="thumb"><a href="http://sandbox.likeorhate.com/user/likeorhate/" title="likeorhate" /><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/userthumbnail/1.jpg?1267463105" alt="likeorhate" /></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="1"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="1"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=1&rate=like"
title="Do you like it? Click now and vote!" thingid="1">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="70" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">100.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="1"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=1&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="1">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="1"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=1&rate=hate"
title="Do you hate it? Click now and vote!" thingid="1">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
<div style="clear: both; height: 1px;"> </div>
</div>
</div>
</div>
<div class="xft">
<div class="xc3"></div>
</div>
</div>
{"version":"1.1","status":true,"message":"","data":{"rate":{"1":{"id":"1","querylabel":"1","created":"2010-03-01 14:04:36","updated":"2010-03-01 14:05:05","link":"http:\/\/sandbox.likeorhate.com\/user\/likeorhate\/","label":"likeorhate","like":{"barwidth":70,"percent":"100.0","rating":1},"whatever":{"barwidth":0,"percent":"0.0","rating":"0"},"hate":{"barwidth":0,"percent":"0.0","rating":"0"},"average":"0.640449438202247","statistics":{"related":0,"comment":"0","trackbackhits":"0","trackbackurl":"0","tbrating":"0"},"thumb":{"src":"http:\/\/static.likeorhate.com\/images\/nopicture.png","id":0}}}}}
array (
'version' => '1.1',
'status' => true,
'message' => '',
'data' =>
array (
'rate' =>
array (
1 =>
array (
'id' => '1',
'querylabel' => '1',
'created' => '2010-03-01 14:04:36',
'updated' => '2010-03-01 14:05:05',
'link' => 'http://sandbox.likeorhate.com/user/likeorhate/',
'label' => 'likeorhate',
'like' =>
array (
'barwidth' => 70,
'percent' => '100.0',
'rating' => 1,
),
'whatever' =>
array (
'barwidth' => 0,
'percent' => '0.0',
'rating' => '0',
),
'hate' =>
array (
'barwidth' => 0,
'percent' => '0.0',
'rating' => '0',
),
'average' => '0.640449438202247',
'statistics' =>
array (
'related' => 0,
'comment' => '0',
'trackbackhits' => '0',
'trackbackurl' => '0',
'tbrating' => '0',
),
'thumb' =>
array (
'src' => 'http://static.likeorhate.com/images/nopicture.png',
'id' => 0,
),
),
),
),
)
Related things. Other things which are related to this one.
Here's an example for the query: http://sandbox.likeorhate.com/rest/thing/related/:
<likeorhate status="true" version="1.1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:media="http://search.yahoo.com/mrss" xmlns:osoc="http://web-semantics.org/ns/opensocial" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xfn="http://gmpg.org/xfn/11#">
<items>
<item>
<thing>
<id>12</id>
<label xml:lang="en">Some random thing</label>
<link href="http://sandbox.likeorhate.com/thing/12/" rel="self" />
<thumb id="0" src="http://static.likeorhate.com/images/nopicture.png" />
</thing>
</item>
<item>
<thing>
<id>13</id>
<label xml:lang="en">LikeOrHate Sandbox</label>
<link href="http://sandbox.likeorhate.com/thing/13/" rel="self" />
<thumb id="0" src="http://static.likeorhate.com/images/nopicture.png" />
</thing>
</item>
</items>
</likeorhate>
<h2>Related</h2><div class="roundedbox daylight" style=""> <div class="xhd">
<div class="xc"></div>
</div>
<div class="xbd">
<div class="xc2">
<div class="xs">
<div style="clear: both; height: 1px;"> </div>
<ul class="thumbs bordered "><li class="bkg0"><div about="http://sandbox.likeorhate.com/thing/12/" class="item loh_smallthing lohthing12">
<div class="title">
<a href="http://sandbox.likeorhate.com/thing/12/Some_random_thing" property="dc:title" title="Click for more!">Some random thing</a>
</div>
<div class="thumb"><a thingid="12" href="http://sandbox.likeorhate.com/thing/12/Some_random_thing"><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/images/nopicture.png" alt="" /><div class="thingthumb" mediaid="0" href="http://static.likeorhate.com/images/nopicture.png">More images</div></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="12"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="12"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=12&rate=like"
title="Do you like it? Click now and vote!" thingid="12">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="0" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="12"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=12&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="12">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="70" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">100.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="12"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=12&rate=hate"
title="Do you hate it? Click now and vote!" thingid="12">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
</li><li class="bkg1"><div about="http://sandbox.likeorhate.com/thing/13/" class="item loh_smallthing lohthing13">
<div class="title">
<a href="http://sandbox.likeorhate.com/thing/13/LikeOrHate_Sandbox" property="dc:title" title="Click for more!">LikeOrHate Sandbox</a>
</div>
<div class="thumb"><a thingid="13" href="http://sandbox.likeorhate.com/thing/13/LikeOrHate_Sandbox"><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/images/nopicture.png" alt="" /><div class="thingthumb" mediaid="0" href="http://static.likeorhate.com/images/nopicture.png">More images</div></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="13"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="13"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=13&rate=like"
title="Do you like it? Click now and vote!" thingid="13">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="70" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">100.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="13"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=13&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="13">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="13"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=13&rate=hate"
title="Do you hate it? Click now and vote!" thingid="13">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
</li></ul><br style="clear: both;"/> <div style="clear: both; height: 1px;"> </div>
</div>
</div>
</div>
<div class="xft">
<div class="xc3"></div>
</div>
</div>
{"version":"1.1","status":true,"message":"","data":{"related":{"9":{"12":"12","13":"13"}}}}
array (
'version' => '1.1',
'status' => true,
'message' => '',
'data' =>
array (
'related' =>
array (
9 =>
array (
12 => '12',
13 => '13',
),
),
),
)
thing/create: Create thing
Creates a new basic thing; that is, this command should not be used to create comments,
users or lists. Remember, this must be a POST request. These are the required parameters:
- loh:label
- String. Thing label. If you want to add more than one label, see
setdata.
- loh:language
- String. Language code for label and description.
- loh:summary
- String. Summary (up to 255 chars). Optional, but highly recommended.
Besides these mandatory fields, you may also use any of the
supported attribute fields. Note that you must prefix
these attribute fields (i.e., anything in your query that
is in this list) with "loh:", which enables you to
mix your own data in HTML forms and quickly filter
them out. Fields which are not attributes (such as responseType) should not
be prefixed with "loh:". Also note that the code
libraries already do this prefixing for you automatically.
Here's an example for the query: http://sandbox.likeorhate.com/rest/thing/create/:
<likeorhate message="" status="true" version="1.1">
<thing>
<id>20</id>
</thing>
</likeorhate>
Do not use HTML in POST methods.
{"version":"1.1","status":true,"message":"","data":{"thing":{"id":"21"}}}
array (
'version' => '1.1',
'status' => true,
'message' => '',
'data' =>
array (
'thing' =>
array (
'id' => '22',
),
),
)
thing/editable
This command provides easy to use functionality to access the LikeOrHate database, returning
data already formatted, editable forms and more. It's much higher level compared to the
other commands. As of this writing, only the HTML responseType is implemented,
as others don't make sense. JSONHTML will be supported in the future.
The HTML code is ready to be put into a <form> tag (the form tag is not sent in
the output) and posted to LikeOrHate REST services. If you want to add your own fields,
you can also do that. This function also automatically adds the "loh:" prefix as
required, so you don't have to worry about that either. We append some Javascript to
the code, which handles validation and other things and which requires you to
include <script type="text/javascript" src="http://likeorhate.com/js/likeorhate.js"></script>
to your HTML source code.
Renders an editable form with the chosen fields for a given thing, filling default
values. You may use the thing parameter id=0 to render an empty editable form,
which can be used to create new things.
This command uses the a parameter fields (explained here)
to select the data to be rendered. Valid field parameters:
- value
- Default value for this field. Default: null.
- comment
- String. A comment explaining this field.
- required
- Boolean. Whether this field must be filled. Default: false.
- hidden
- Whether this field should not be shown. The thing id is returned hidden by
default if the thing exists.
Since there's a limit to the length of HTTP GET requests that can be easily overriden with
a long fields parameter, this command also responds to POST requests, even though
it is read-only.
Here's an example for the query: http://sandbox.likeorhate.com/rest/thing/editable
<div class="loh_form"><div class="loh_form_item">
<label class="loh_formlabel" for="form_id_label"><span class="loh_fieldlabel">Label:</span><span class="loh_required">*</span><span class="loh_explanation">Thing name</span> </label> <input id="form_id_label" type="text" name="loh:label" class="loh_input loh_unique required " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_label_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_hasTag"><span class="loh_fieldlabel">Tags:</span><span class="loh_required">*</span><span class="loh_explanation">Tags, comma-delimited</span> </label> <input id="form_id_hasTag" type="text" name="loh:hasTag" class="loh_input loh_multiplethingselector required " value="" maxlength="255" /><p class="loh_validation_message" id="form_id_hasTag_message"></p></div>
<script type="text/javascript">
function loh_setRadioChoice(idx) {
var upload = $lhj('#origin_upload');
var url = $lhj('#origin_url');
upload.css('display', 'none');
url.css('display', 'none');
if (idx == 'upload') {
upload.css('display', 'block');
}
else {
url.css('display', 'block');
}
}
</script>
<fieldset class="loh_fieldset">
<legend class="loh_legend">File</legend>
<span class="loh_explanation">Logo</span> <div class="loh_form_item">
<label class="loh_formlabel">
<span class="loh_fieldlabel">The file comes</span>
</label>
<label for="loh_filedata_source_url">
<input type="radio" value="url" id="loh_filedata_source_url" name="loh:filedata_origin" checked onClick="loh_setRadioChoice('url');" />
From a site </label>
<label for="loh_filedata_source_upload">
<input type="radio" value="upload" id="loh_filedata_source_upload" name="loh:filedata_origin" onClick="loh_setRadioChoice('upload');" />
From your computer </label>
</div>
<div class="loh_form_item" id="origin_upload" style="display: none;">
<label for="loh_filedata_medium" class="loh_formlabel">
<span class="loh_fieldlabel">File</span>
</label>
<input type="file" id="loh_filedata_medium" name="loh:filedata_medium" size="30" />
</div>
<div class="loh_form_item" id="origin_url" >
<label for="loh_filedata_url" class="loh_formlabel">
<span class="loh_fieldlabel">Link for the file (URI)</span>:
</label>
<input type="text" id="loh_filedata_url" name="loh:filedata_url" class="loh_input" value="http://" />
</div>
<div class="loh_form_item">
<label for="loh_summary" class="loh_formlabel">
<span class="loh_fieldlabel">Summary for file</span>
<span class="loh_explanation">Please describe it briefly</span>
</label>
<input type="text" id="loh_summary" name="loh:summary" class="loh_input" maxlength="255" />
</div>
<div class="loh_form_item">
<label for="loh_filedata_license" class="loh_formlabel">
<span class="loh_fieldlabel">License for this file</span>
<span class="loh_explanation">Please select the appropriate file license</span>
</label>
<select id="loh_filedata_license" name="loh:filedata_license">
<option value="Public domain">Public domain</option>
<option value="Creative Commons BY-SA">Creative Commons BY-SA</option>
<option value="GNU Free Documentation License (GFDL)">GNU Free Documentation License (GFDL)</option>
<option value="Copyrighted and licensed to LikeOrHate">Copyrighted, but copyright holder grants free use</option>
</select>
</div>
</fieldset>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_summary"><span class="loh_fieldlabel">Summary (short description):</span><span class="loh_required">*</span><span class="loh_explanation">Short description</span> </label> <input id="form_id_summary" type="text" name="loh:summary" class="loh_input required " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_summary_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_description"><span class="loh_fieldlabel">Description:</span><span class="loh_explanation">Long description</span> </label> <textarea id="form_id_description" class="loh_html_editor " name="loh:description"></textarea><p class="loh_validation_message" id="form_id_description_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_foaf_homepage"><span class="loh_fieldlabel">Homepage:</span><span class="loh_explanation">Website:</span> </label> <input id="form_id_foaf_homepage" type="text" name="loh_input loh:foaf_homepage" value="http://" class="url " maxlength="255" /><p class="loh_validation_message" id="form_id_foaf_homepage_message"></p></div>
<fieldset class="loh_fieldset"><legend class="loh_legend">Place</legend><span class="loh_explanation">Optional, your address</span> <div class="loh_form_item">
<label class="loh_formlabel" for="form_id_place_street_address"><span class="loh_fieldlabel">Street address:</span></label> <input id="form_id_place_street_address" type="text" name="loh:place_street_address" class="loh_input " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_place_street_address_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_place_post_office_box"><span class="loh_fieldlabel">Post Office Box:</span></label> <input id="form_id_place_post_office_box" type="text" name="loh:place_post_office_box" class="loh_input " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_place_post_office_box_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_place_extended_address"><span class="loh_fieldlabel">Extended address:</span></label> <input id="form_id_place_extended_address" type="text" name="loh:place_extended_address" class="loh_input " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_place_extended_address_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_place_locality"><span class="loh_fieldlabel">City/locality:</span></label> <input id="form_id_place_locality" type="text" name="loh:place_locality" class="loh_input " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_place_locality_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_place_region"><span class="loh_fieldlabel">State/region:</span></label> <input id="form_id_place_region" type="text" name="loh:place_region" class="loh_input " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_place_region_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_place_postal_code"><span class="loh_fieldlabel">Postal code:</span></label> <input id="form_id_place_postal_code" type="text" name="loh:place_postal_code" class="loh_input " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_place_postal_code_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_foaf_country"><span class="loh_fieldlabel">Country:</span></label> <select id="form_id_foaf_country" name="loh:foaf_country" class="loh_select " ></select><p class="loh_validation_message" id="form_id_foaf_country_message"></p></div>
</fieldset><fieldset class="loh_fieldset"><legend class="loh_legend">Contact</legend><span class="loh_explanation">Contact information.</span> <div class="loh_form_item">
<label class="loh_formlabel" for="form_id_email"><span class="loh_fieldlabel">Email:</span><span class="loh_explanation">Will be protected against spammers</span> </label> <input id="form_id_email" type="text" name="loh:email" class="loh_input " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_email_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_phone"><span class="loh_fieldlabel">Phone:</span></label> <input id="form_id_phone" type="text" name="loh:phone" class="loh_input " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_phone_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_fax"><span class="loh_fieldlabel">Fax:</span></label> <input id="form_id_fax" type="text" name="loh:fax" class="loh_input " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_fax_message"></p></div>
<div class="loh_form_item">
<label class="loh_formlabel" for="form_id_mobiletel"><span class="loh_fieldlabel">Mobile phone:</span></label> <input id="form_id_mobiletel" type="text" name="loh:mobiletel" class="loh_input " value="" maxlength="255"/><p class="loh_validation_message" id="form_id_mobiletel_message"></p></div>
</fieldset></div><script type="text/javascript" src="http://sandbox.likeorhate.com/js/internal/jquery.validate.js"></script>
<script type="text/javascript">
(function() {
if (typeof($lhj) == 'undefined') {return;}
// make JS validate fields automatically.
$lhj("div.loh_form").parent("form").validate();
// html textareas
$lhj('textarea.loh_html_editor').rte({ media_url: "http://static.likeorhate.com/images/rte-jquery/"});
// single association
$lhj(".loh_singlethingselector").autocomplete("http://sandbox.likeorhate.com/rest/search/autocomplete/?responseType=JSON", {
width: 320,
dataType: "json",
highlight: false,
scroll: true,
scrollHeight: 300,
multiple: false,
mustMatch: false,
parse: function(json) {
if (json.status == false || json.data.search.results == 0)
return [];
var total = json.data.search.results;
var parsed = [];
for (var id in json.data.search.list.list) {
var item = json.data.search.list.list[id];
parsed[parsed.length] = {
data: "\<img src='" + item.thumbnail + "'/\> " + item.label,
value: 2,
result: item.label
};
}
return parsed;
},
formatItem: function(data, i, n, value) {
return data;
} /*,
formatResult: function(data, value) {
return value.split(".")[0];
}*/
});
// multiple association
$lhj(".loh_multiplethingselector").autocomplete("http://sandbox.likeorhate.com/rest/search/autocomplete/?responseType=JSON", {
width: 320,
dataType: "json",
highlight: false,
scroll: true,
scrollHeight: 300,
multiple: true,
multipleSeparator: ", ",
mustMatch: true,
parse: function(json) {
if (json.status == false || json.data.search.results == 0)
return [];
var total = json.data.search.results;
var parsed = [];
for (var id in json.data.search.list.list) {
var item = json.data.search.list.list[id];
parsed[parsed.length] = {
data: "\<img src='" + item.thumbnail + "'/\> " + item.label,
value: 2,
result: item.label
};
}
return parsed;
},
formatItem: function(data, i, n, value) {
return data;
},
/*,
formatResult: function(data, value) {
return value.split(".")[0];
}*/
});
$lhj(".loh_multiplethingselector").result(function(event, data, formatted) {
var select = $lhj(this).parent().find('select');
$lhj(select).append($lhj("<option><\/option>").attr("value", formatted).text(data));
});
// on blur of unique inputs, check if it exists
$lhj("input.loh_unique").blur(function() {
var eventgen = $lhj(this);
$lhj.get('http://sandbox.likeorhate.com/addthing/',
{ procedure: 'searchlabel', label: $lhj(this).val() },
function(data, status) {
var messageid = "#" + eventgen.attr("id") + '_message';
if (eventgen.val().length == 0) {
// nothing
}
else if (status == 'success' && data.length > 20) { //
$lhj(messageid).html("<p><strong>No duplicate names are allowed.<\/strong> Check if one of these things is what you were planning to add:<\/p>"
+ data + "<p style=\"clear:both;\">If not, then fill the data below!<\/p>").css({"display": "block", "color": "#F00"});
}
else {
$lhj(messageid).html("<p>Valid label!<\/p>").css({"display": "block", "color": "#0B0"});
}
}
);
});
/* $lhj.datepicker.setDefaults($lhj.extend({showMonthAfterYear: false}, $lhj.datepicker.regional['']));
$lhj("input.datepicker").datepicker($lhj.datepicker.regional['en']); */
})();
</script>
array (
'label' =>
array (
'comment' => 'Thing name',
'required' => true,
),
'hasTag' =>
array (
'comment' => 'Tags, comma-delimited',
'required' => true,
),
'filedata' =>
array (
'comment' => 'Logo',
'type' => 'filedata',
),
'summary' =>
array (
'comment' => 'Short description',
'required' => true,
),
'description' =>
array (
'comment' => 'Long description',
),
'foaf_homepage' =>
array (
'comment' => 'Website:',
),
'place' =>
array (
'comment' => 'Optional, your address',
'fields' =>
array (
'foaf_country' =>
array (
'value' => 'Brazil',
'readonly' => true,
),
'place_street_pobox' =>
array (
'comment' => 'Optional',
),
'latitude' =>
array (
'hidden' => true,
),
'longitude' =>
array (
'hidden' => true,
),
),
),
'contact' =>
array (
'comment' => 'Contact information.',
'fields' =>
array (
'email' =>
array (
'comment' => 'Will be protected against spammers',
),
),
),
)
thing/setdata: Add or change data of a thing
Under implementation.
User command
Functions for the user command return what was made by
the user. For example, if you want the comments written by a user, you should
call /rest/user/comments/?id=xx, but if you want comments about a user,
you should call /rest/thing/comments/?id=xx. Remember that users are things
as well, so all thing functions work for users as well, although the permissions are
more restrictive.
Users can choose to have some of their data as private, or accessible only
by friends. In this case you'll have to be logged in to be
able to access the data and also to have permission from the user to do so.
See also the grants section.
Functions for the 'user' command:
- profile
- Profile information for the user. Read-write.
- rating
- Ratings made by the user. Read-only.
- friends
- Relations (friends, etc) for the user. Read-only.
- comment
- Comments written by the user. Read-only.
- recommendation
- Thing recommendations for the user. Read-only.
- editable
- Not implemented yet. Read-only.
user/profile
Profile information for the user. We mainly follow FOAF, but
sometime soon we'll also implement
opensocial.Person.
Here's an example for the query: http://sandbox.likeorhate.com/rest/user/profile/?username=likeorhate:
<likeorhate status="true" version="1.1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:media="http://search.yahoo.com/mrss" xmlns:osoc="http://web-semantics.org/ns/opensocial" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xfn="http://gmpg.org/xfn/11#">
<foaf:Person rdf:about="http://sandbox.likeorhate.com/user/likeorhate/" xmlns:foaf="http://xmlns.com/foaf/0.1/">
<foaf:holdsAccount>
<foaf:OnlineAccount>
<foaf:accountProfilePage dc:title="LikeOrHate" rdf:resource="http://sandbox.likeorhate.com/user/likeorhate/" />
<foaf:accountServiceHomepage dc:title="LikeOrHate" rdf:resource="http://sandbox.likeorhate.com" />
<foaf:accountName>likeorhate</foaf:accountName>
</foaf:OnlineAccount>
</foaf:holdsAccount>
<foaf:name>LikeOrHate</foaf:name>
<foaf:theme />
<foaf:gender>0</foaf:gender>
<foaf:title>Website</foaf:title>
<foaf:nick>LoH</foaf:nick>
<foaf:img rdf:resource="" />
<foaf:homepage rdf:resource="http://sandbox.likeorhate.com/" />
<foaf:weblog rdf:resource="http://sandbox.likeorhate.com/" />
<foaf:workplaceHomepage rdf:resource="http://sandbox.likeorhate.com/" />
</foaf:Person>
<osoc:Person rdf:about="http://sandbox.likeorhate.com/user/likeorhate/" xmlns="http://ns.opensocial.org/2008/opensocial" />
</likeorhate>
<div class="vcard"><table width="80%" class="centered_data" typeof="foaf:Person" xmlns:foaf="http://xmlns.com/foaf/0.1/">
<tr class="info1">
<td class="key">Username:</td>
<td class="value"><a href="http://sandbox.likeorhate.com/user/likeorhate/" class="url fn nickname">likeorhate</a></td>
</tr>
<tr class="info2">
<td colspan="2"><h2>Profile (optional)</h2></td>
</tr>
<tr class="info1">
<td class="key">Full name:</td>
<td class="value"><span property="foaf:name"></span></td>
</tr>
<tr class="info2">
<td class="key">Title (Mr., Mrs., Dr., etc):</td>
<td class="value"><span class="honorific-prefix" property="foaf:title">Website</span></td>
</tr>
<tr class="info1">
<td class="key">Short description of myself:</td>
<td class="value"><span property="foaf:theme"></span></td>
</tr>
<tr class="info2">
<td class="key">Gender:</td>
<td class="value">0</td>
</tr>
<tr class="info1">
<td class="key">Nick:</td>
<td class="value"><span property="foaf:nick">LoH</span></td>
</tr>
<tr class="info2">
<td class="key">Birthday:</td>
<td class="value"><span property="foaf:birthday">2000-01-01</span></td>
</tr>
<tr class="info1">
<td class="key">Country:</td>
<td class="value"><span class="country-name" property="foaf:country"></span></td>
</tr>
<tr class="info2">
<td class="key">City:</td>
<td class="value"><span class="locality" property="foaf:city"></span></td>
</tr>
<tr class="info1">
<td class="key">Homepage:</td>
<td class="value"><a class="url" href="http://sandbox.likeorhate.com/">http://sandbox.likeorhate.com/</a></td>
</tr>
<tr class="info2">
<td class="key">Blog:</td>
<td class="value"><a class="url" href="http://sandbox.likeorhate.com/">http://sandbox.likeorhate.com/</a></td>
</tr>
<tr class="info1">
<td class="key">Work homepage:</td>
<td class="value"><a class="url" href="http://sandbox.likeorhate.com/">http://sandbox.likeorhate.com/</a></td>
</tr>
<tr class="info2">
<td class="key">Homepage of the school you went to:</td>
<td class="value"><a class="url" href="http://sandbox.likeorhate.com/">http://sandbox.likeorhate.com/</a></td>
</tr>
</table>
</div>
{"version":"1.1","status":true,"message":"","data":{"profile":{"permalink":"http:\/\/sandbox.likeorhate.com\/user\/likeorhate\/","username":"likeorhate","foaf_fullname":"LikeOrHate","foaf_theme":"","foaf_gender":"0","foaf_nick":"LoH","foaf_title":"Website","foaf_homepage":"http:\/\/sandbox.likeorhate.com\/","foaf_weblog":"http:\/\/sandbox.likeorhate.com\/","foaf_email":"false@likeorhate.com","foaf_img":null,"foaf_workplaceHomepage":"http:\/\/sandbox.likeorhate.com\/","foaf_schoolHomepage":"http:\/\/sandbox.likeorhate.com\/","foaf_birthday":"2000-01-01","foaf_country":null,"foaf_city":null}}}
array (
'version' => '1.1',
'status' => true,
'message' => '',
'data' =>
array (
'profile' =>
array (
'permalink' => 'http://sandbox.likeorhate.com/user/likeorhate/',
'username' => 'likeorhate',
'foaf_fullname' => 'LikeOrHate',
'foaf_theme' => '',
'foaf_gender' => '0',
'foaf_nick' => 'LoH',
'foaf_title' => 'Website',
'foaf_homepage' => 'http://sandbox.likeorhate.com/',
'foaf_weblog' => 'http://sandbox.likeorhate.com/',
'foaf_email' => 'false@likeorhate.com',
'foaf_img' => NULL,
'foaf_workplaceHomepage' => 'http://sandbox.likeorhate.com/',
'foaf_schoolHomepage' => 'http://sandbox.likeorhate.com/',
'foaf_birthday' => '2000-01-01',
'foaf_country' => NULL,
'foaf_city' => NULL,
),
),
)
user/rating
Ratings that this user has made. These are not ratings for the user, which are
accessed with thing/rate, but ratings by the
user.
Here's an example for the query: http://sandbox.likeorhate.com/rest/user/rating/?username=likeorhate:
<likeorhate status="true" version="1.1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:media="http://search.yahoo.com/mrss" xmlns:osoc="http://web-semantics.org/ns/opensocial" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xfn="http://gmpg.org/xfn/11#">
<items total="3">
<item>
<id>9</id>
<rate>like</rate>
</item>
<item>
<id>12</id>
<rate>whatever</rate>
</item>
<item>
<id>13</id>
<rate>like</rate>
</item>
</items>
</likeorhate>
<ul class="thumbs bordered multiline breakthrees"><li class="bkg0"><div about="http://sandbox.likeorhate.com/thing/9/" class="item loh_smallthing lohthing9">
<div class="title">
<a href="http://sandbox.likeorhate.com/thing/9/sandbox.likeorhate.com" property="dc:title" title="Click for more!">LikeOrHate.com</a>
</div>
<div class="thumb"><a thingid="9" href="http://sandbox.likeorhate.com/thing/9/sandbox.likeorhate.com"><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/images/nopicture.png" alt="" /><div class="thingthumb" mediaid="0" href="http://static.likeorhate.com/images/nopicture.png">More images</div></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="9"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="9"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=9&rate=like"
title="Do you like it? Click now and vote!" thingid="9">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="70" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">100.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="9"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=9&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="9">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="9"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=9&rate=hate"
title="Do you hate it? Click now and vote!" thingid="9">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
</li><li class="bkg1"><div about="http://sandbox.likeorhate.com/thing/12/" class="item loh_smallthing lohthing12">
<div class="title">
<a href="http://sandbox.likeorhate.com/thing/12/Some_random_thing" property="dc:title" title="Click for more!">Some random thing</a>
</div>
<div class="thumb"><a thingid="12" href="http://sandbox.likeorhate.com/thing/12/Some_random_thing"><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/images/nopicture.png" alt="" /><div class="thingthumb" mediaid="0" href="http://static.likeorhate.com/images/nopicture.png">More images</div></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="12"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="12"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=12&rate=like"
title="Do you like it? Click now and vote!" thingid="12">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="0" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="12"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=12&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="12">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="70" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">100.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="12"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=12&rate=hate"
title="Do you hate it? Click now and vote!" thingid="12">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
</li><li class="bkg2"><div about="http://sandbox.likeorhate.com/thing/13/" class="item loh_smallthing lohthing13">
<div class="title">
<a href="http://sandbox.likeorhate.com/thing/13/LikeOrHate_Sandbox" property="dc:title" title="Click for more!">LikeOrHate Sandbox</a>
</div>
<div class="thumb"><a thingid="13" href="http://sandbox.likeorhate.com/thing/13/LikeOrHate_Sandbox"><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/images/nopicture.png" alt="" /><div class="thingthumb" mediaid="0" href="http://static.likeorhate.com/images/nopicture.png">More images</div></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="13"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="13"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=13&rate=like"
title="Do you like it? Click now and vote!" thingid="13">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="70" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">100.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="13"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=13&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="13">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="13"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=13&rate=hate"
title="Do you hate it? Click now and vote!" thingid="13">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
</li></ul><br style="clear: both;"/><div style="clear:both; text-align: center; padding-top: 30px; margin: 20px auto;"></div>Page: 1 <style type="text/css" media="screen">.lohthing9 div.vote-like .iconuservote {display: inline;}.lohthing12 div.vote-whatever .iconuservote {display: inline;}.lohthing13 div.vote-like .iconuservote {display: inline;}</style>
{"version":"1.1","status":true,"message":"","data":{"rating":{"data":{"9":{"rating":"like"},"12":{"rating":"whatever"},"13":{"rating":"like"}},"total":"3"}}}
array (
'version' => '1.1',
'status' => true,
'message' => '',
'data' =>
array (
'rating' =>
array (
'data' =>
array (
9 =>
array (
'rating' => 'like',
),
12 =>
array (
'rating' => 'whatever',
),
13 =>
array (
'rating' => 'like',
),
),
'total' => '3',
),
),
)
user/friends
Returns friendship information (using XFN).
Here's an example for the query: http://sandbox.likeorhate.com/rest/user/friends/?username=likeorhate:
<likeorhate status="true" version="1.1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:media="http://search.yahoo.com/mrss" xmlns:osoc="http://web-semantics.org/ns/opensocial" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xfn="http://gmpg.org/xfn/11#">
<items>
<item id="2">
<xfn:friend rdf:resource="http://sandbox.likeorhate.com/user/?id=2" />
<xfn:co-worker rdf:resource="http://sandbox.likeorhate.com/user/?id=2" />
<xfn:neighbor rdf:resource="http://sandbox.likeorhate.com/user/?id=2" />
</item>
</items>
</likeorhate>
<ul class="thumbs bordered "><li class="bkg0"><div about="http://sandbox.likeorhate.com/user/likeorhatetest/" class="item loh_smallthing lohthing2">
<div class="title">
<a href="http://sandbox.likeorhate.com/user/likeorhatetest/" property="dc:title" title="Click for more!">likeorhatetest</a>
</div>
<div class="thumb"><a href="http://sandbox.likeorhate.com/user/likeorhatetest/" title="likeorhatetest" /><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/userthumbnail/2.jpg?1267463076" alt="likeorhatetest" /></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="2"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="2"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=2&rate=like"
title="Do you like it? Click now and vote!" thingid="2">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="0" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="2"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=2&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="2">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="2"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=2&rate=hate"
title="Do you hate it? Click now and vote!" thingid="2">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
</li></ul><br style="clear: both;"/><div style="clear:both; text-align: center; padding-top: 30px; margin: 20px auto;"></div>Page: 1
{"version":"1.1","status":true,"message":"","data":{"friends":{"2":"friend,co-worker,neighbor"}}}
array (
'version' => '1.1',
'status' => true,
'message' => '',
'data' =>
array (
'friends' =>
array (
2 => 'friend,co-worker,neighbor',
),
),
)
This returns comments written by the user.
Here's an example for the query: http://sandbox.likeorhate.com/rest/user/comment/?username=likeorhate:
user/recommendation
Not implemented yet.
user/editable
Not implemented yet.
Comments are applied to things (including users and lists). If you are
looking for private messages between two users, you want the
message command. Functions for the 'comment' command:
- comment
- The comment and associated information. Read-only.
- replies
- Returns the replies to a given comment. Read-only.
- create
- Creates a new comment.
This returns a comment, given its id. We tried to follow RSS 2.0
as much as possible. Fields:
- guid
- URI. A unique universal id. It's actually the web URL to the comment.
- id
- The comment id (unsigned integer).
- thing
- The thing this comment is about (unsigned integer).
- parent
- The parent comment id, if this is a reply; 0 otherwise.
- replies
- Number of replies for this comment.
- author
- Author username.
- authorLink
- Link for author's page.
- authorRate
- Author's rate for the thing.
- pubDate
- Date it was written.
- title
- Title or subject.
- message
- Message. May contain safe HTML code.
- from
- From which URL has this been written? May be empty.
- link
- Web url for this comment.
- created
- Date it was written. Same as pubDate.
- updated
- Date it was last updated.
- like
- How many like votes for this comment.
- whatever
- How many whatever votes for this comment.
- hate
- How many hate votes for this comment.
- average
- Average score for this comment.
Here's an example for the query: http://sandbox.likeorhate.com/rest/comment/comment/?id=xx:
This returns all the replies for a comment, given its id.
Here's an example for the query: http://sandbox.likeorhate.com/rest/comment/replies/?id=:
Creates a new comment. Must be POST. Arguments:
- thing
- The id for the thing you're commenting.
- language
- The language of this comment.
- subject
- The subject. Cannot be null, unless it's a reply.
- message
- The comment body. May contain HTML, but it will be filtered to
remove everything except basic tags.
- parent
- Optional. The id for the comment you're replying to. If not a
reply, don't set this field or set it to 0.
- postedFrom
- Optional. URL where the comment was posted.
We return the new comment id and the id of the thing it's about.
Here's an example for the query: http://sandbox.likeorhate.com/rest/comment/create/:
List command
Functions for the 'list' command:
- base
- The list with basic information. Read-only.
- information
- The list and more information. Read-only.
- create
- Creates a new list. Write-only
Remember that list are things, so you can use functions from the thing command as well.
list/base
This returns basic information about a list, including name, description and a list of items.
Here's an example for the query: http://sandbox.likeorhate.com/rest/list/base/?id=:
<likeorhate status="true" version="1.1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:media="http://search.yahoo.com/mrss" xmlns:osoc="http://web-semantics.org/ns/opensocial" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xfn="http://gmpg.org/xfn/11#">
<thing>
<id>14</id>
<label xml:lang="en">Basic list</label>
<link href="http://sandbox.likeorhate.com/thing/14/" rel="self" />
<thumb id="0" src="http://static.likeorhate.com/images/nopicture.png" />
</thing>
</likeorhate>
<div class="roundedbox daylight" style=""> <div class="xhd">
<div class="xc"></div>
</div>
<div class="xbd">
<div class="xc2">
<div class="xs">
<div style="clear: both; height: 1px;"> </div>
<div about="http://sandbox.likeorhate.com/thing/14/" class="item loh_smallthing lohthing14">
<div class="title">
<a href="http://sandbox.likeorhate.com/thing/14/Basic_list" property="dc:title" title="Click for more!">Basic list</a>
</div>
<div class="thumb"><a thingid="14" href="http://sandbox.likeorhate.com/thing/14/Basic_list"><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/images/nopicture.png" alt="" /><div class="thingthumb" mediaid="0" href="http://static.likeorhate.com/images/nopicture.png">More images</div></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="14"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="14"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=14&rate=like"
title="Do you like it? Click now and vote!" thingid="14">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="0" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="14"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=14&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="14">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="14"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=14&rate=hate"
title="Do you hate it? Click now and vote!" thingid="14">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
<div style="clear: both; height: 1px;"> </div>
</div>
</div>
</div>
<div class="xft">
<div class="xc3"></div>
</div>
</div>
{"version":"1.1","status":true,"message":"","data":{"list":{"id":"14","label":"Basic list","label_language":"en","link":"http:\/\/sandbox.likeorhate.com\/thing\/14\/","thumbnail":"http:\/\/static.likeorhate.com\/images\/nopicture.png"}}}
array (
'version' => '1.1',
'status' => true,
'message' => '',
'data' =>
array (
'list' =>
array (
'id' => '14',
'label' => 'Basic list',
'label_language' => 'en',
'link' => 'http://sandbox.likeorhate.com/thing/14/',
'thumbnail' => 'http://static.likeorhate.com/images/nopicture.png',
),
),
)
This returns extended information about a list, including name, description, statistics
and detailed information on its things.
Here's an example for the query: http://sandbox.likeorhate.com/rest/list/information/?id=:
<likeorhate status="true" version="1.1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:media="http://search.yahoo.com/mrss" xmlns:osoc="http://web-semantics.org/ns/opensocial" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xfn="http://gmpg.org/xfn/11#">
<thinglist>
<items total="3">
<item>
<thing>
<id>9</id>
<label xml:lang="en">LikeOrHate.com</label>
<link href="http://sandbox.likeorhate.com/thing/9/" rel="self" />
<thumb id="0" src="http://static.likeorhate.com/images/nopicture.png" />
</thing>
<note />
</item>
<item>
<thing>
<id>12</id>
<label xml:lang="en">Some random thing</label>
<link href="http://sandbox.likeorhate.com/thing/12/" rel="self" />
<thumb id="0" src="http://static.likeorhate.com/images/nopicture.png" />
</thing>
<note />
</item>
<item>
<thing>
<id>13</id>
<label xml:lang="en">LikeOrHate Sandbox</label>
<link href="http://sandbox.likeorhate.com/thing/13/" rel="self" />
<thumb id="0" src="http://static.likeorhate.com/images/nopicture.png" />
</thing>
<note />
</item>
</items>
</thinglist>
</likeorhate>
<h1>List: Basic list</h1><h2>by <span class="author"><a href="http://sandbox.likeorhate.com/user/likeorhate">likeorhate</a>
<img width="16" height="16" class="loh_userinfo" alt="More information about the user" data-id="1" src="http://static.likeorhate.com/images/icons/16x16/1downarrow.png"/></span>
</h2><p>This is a basic list for testing!</p><ul class="thumbs bordered multiline"><li class="bkg0"><div about="http://sandbox.likeorhate.com/thing/9/" class="item loh_smallthing lohthing9">
<div class="title">
<a href="http://sandbox.likeorhate.com/thing/9/sandbox.likeorhate.com" property="dc:title" title="Click for more!">LikeOrHate.com</a>
</div>
<div class="thumb"><a thingid="9" href="http://sandbox.likeorhate.com/thing/9/sandbox.likeorhate.com"><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/images/nopicture.png" alt="" /><div class="thingthumb" mediaid="0" href="http://static.likeorhate.com/images/nopicture.png">More images</div></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="9"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="9"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=9&rate=like"
title="Do you like it? Click now and vote!" thingid="9">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="70" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">100.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="9"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=9&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="9">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="9"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=9&rate=hate"
title="Do you hate it? Click now and vote!" thingid="9">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
<div class="note"></div></li><li class="bkg1"><div about="http://sandbox.likeorhate.com/thing/12/" class="item loh_smallthing lohthing12">
<div class="title">
<a href="http://sandbox.likeorhate.com/thing/12/Some_random_thing" property="dc:title" title="Click for more!">Some random thing</a>
</div>
<div class="thumb"><a thingid="12" href="http://sandbox.likeorhate.com/thing/12/Some_random_thing"><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/images/nopicture.png" alt="" /><div class="thingthumb" mediaid="0" href="http://static.likeorhate.com/images/nopicture.png">More images</div></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="12"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="12"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=12&rate=like"
title="Do you like it? Click now and vote!" thingid="12">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/greenbarcenter.png" border="0" width="0" height="15"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-whatever">
<div class="cleanbutton">
<button type="submit" name="rate" value="whatever"
class="aclickvote vote-whatever cleanbutton" rev="vote-abstain"
title="Don't care for it? Click now and vote!" thingid="12"></button>
</div>
<a class="aclickvote vote-whatever" rev="vote-abstain" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=12&rate=whatever"
title="Don't care for it? Click now and vote!" thingid="12">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_wtvr.png" title= "Whatever" alt="Whatever"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/yellowbarcenter.png" border="0" width="70" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/yellowbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">100.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
<div class="clickvote vote-hate">
<div class="cleanbutton">
<button type="submit" name="rate" value="hate"
class="aclickvote vote-hate cleanbutton" rev="vote-against"
title="Do you hate it? Click now and vote!" thingid="12"></button>
</div>
<a class="aclickvote vote-hate" rev="vote-against" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=12&rate=hate"
title="Do you hate it? Click now and vote!" thingid="12">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_hate.png" title= "I hate" alt="I hate"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarleft.png" border="0" height="15" alt=""/>
<img class="votebar centerimg" src="http://static.likeorhate.com/images/votebar/redbarcenter.png" border="0" width="0" height="15" alt=""/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/redbarright.png" border="0" height="15" alt=""/>
<span class="loh_votebarvotes">0.0%</span>
<span class="iconuservote"><img class="iconuservote" src="http://static.likeorhate.com/images/uservote.png" title="My vote" alt="My vote"/></span>
</a>
<br/>
</div>
</form>
</div>
</div>
</div>
<div class="note"></div></li><li class="bkg2"><div about="http://sandbox.likeorhate.com/thing/13/" class="item loh_smallthing lohthing13">
<div class="title">
<a href="http://sandbox.likeorhate.com/thing/13/LikeOrHate_Sandbox" property="dc:title" title="Click for more!">LikeOrHate Sandbox</a>
</div>
<div class="thumb"><a thingid="13" href="http://sandbox.likeorhate.com/thing/13/LikeOrHate_Sandbox"><img class="thingthumb" property="foaf:depiction" src="http://static.likeorhate.com/images/nopicture.png" alt="" /><div class="thingthumb" mediaid="0" href="http://static.likeorhate.com/images/nopicture.png">More images</div></a></div>
<div class="description ratingparent">
<div style="text-align: left; width:120px;">
<form action="http://sandbox.likeorhate.com/rate/" method="post">
<input type="hidden" name="id" value="13"/>
<div class="clickvote vote-like">
<div class="cleanbutton">
<button type="submit" name="rate" value="like"
class="aclickvote vote-like cleanbutton"
title="Do you like it? Click now and vote!" thingid="13"></button>
</div>
<a class="aclickvote vote-like" rev="vote-for" rel="nofollow" href="http://sandbox.likeorhate.com/rate/?id=13&rate=like"
title="Do you like it? Click now and vote!" thingid="13">
<img class="iconvote" src="http://static.likeorhate.com/images/icon_like.png" title= "I like" alt="I like"/>
<img class="votebar" src="http://static.likeorhate.com/images/votebar/greenbarleft.png"