jQuery widget showing movie rating from kinopoisk.ru (imdb)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE-GPL.txt
LICENSE-MIT.txt
README.md
index-rus.html
index.html
kinopoisk.css
kinopoisk.js
kinopoisk.min.css
kinopoisk.min.js

README.md

About

jQuery Kinopoisk is a plugin that let you easily add to your web page movie rating informer. This informer shows movie rating from kinopoisk.ru and imdb.com. It does not use any server side scripts. It use javascript and css files only.

Getting Started

Include jQuery and the plugin on a page.

<script src="http://yandex.st/jquery/1.7.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="kinopoisk.min.css" />
<script type="text/javascript" src="kinopoisk.min.js"></script>

Use the plugin as follows (89515 - movie id from kinopoisk.ru):

<div class="kinopoisk" data-movie="89515"></div>

That's all!

Customization

Set movie rating order (["kinopoisk", "imdb"] as default):

<div class="kinopoisk" data-movie="89515" data-order='["imdb", "kinopoisk"]'></div>

If you want only one rating:

<div class="kinopoisk" data-movie="89515" data-order='["imdb"]'></div>

Set stars' range (10 as default):

<div class="kinopoisk" data-movie="89515" data-range=5 ></div>

You can use link on movie instead of movie identification.

<div class="kinopoisk" data-movie="http://www.kinopoisk.ru/film/566055" ></div>
Cache time is set on 1 day by default. You can change that attribute (data-cache_time) setting it in milliseconds. Set 0 to switch off cache.

<div class="kinopoisk" data-movie="506005" data-cache_time="0"></div>

Examples

All examples you will see in index.html

API

You can use API to control plugin.

        <div id="my-rating"></div>
        <script>
            $("#my-rating").kinopoisk(
                {
                    "movie": 326,
                    "range": 5,
                    "order": ["imdb", "kinopoisk"]
                }
            );
        </script>
    

You can change informer template.


<div id="my-rating2"></div>
<script>
$("#my-rating2").kinopoisk(
{
"movie": 327,
"order": ["kinopoisk"],
"kinopoisk_template": '<div>' +
'Рейтинг: <span class="kp_stars">$stars</span>' +
'<span class="kp_rating">$rating</span>' +
'<span><small>(Голосов: $vote)</small></span>' +
'</div>',
}
);
</script>

License

This plugin is dual licensed under the MIT and GPL2 licenses, just like jQuery itself.