integ/js/iri.js
changeset 3 046d617a7d6e
parent 2 05fdc9616ba0
child 6 92160118bd31
--- a/integ/js/iri.js	Wed Apr 03 16:52:19 2013 +0200
+++ b/integ/js/iri.js	Wed Apr 03 18:15:31 2013 +0200
@@ -30,14 +30,48 @@
 
 
 //-- API allocine
+
+//-- movie
 var urlMovie = 'http://api.allocine.fr/rest/v3/movie?partner=B00015838755&code='+ idMovie;
 $.getJSON(urlMovie, function(data) {
 	var movie = data.movie;
+
+	//-- title
+	var titleMovie = movie.title;
+	$('.renkan .wrap-top h2').text(titleMovie);
+
+	//-- stars
 	var castMember = movie.castMember;
-	console.log(castMember)
-})
+
+	$.each(castMember, function(k, v){
+		var name =	v.person.name;
+		var codeActor = v.person.code;
+		var urlPicture;
+		if(v.picture !== undefined) {
+			urlPicture = v.picture.href;
+		}else{
+			urlPicture = 'http://fr.web.img3.acsta.net/c_160_213/b_1_d6d6d6/commons/emptymedia/empty_star.jpg';
+		}	
+		var urlFichePersonne = 'http://www.allocine.fr/personne/fichepersonne_gen_cpersonne='+codeActor+'.html';
+		var itemStar = 
+			'<li><a target="_blank" href="'+ urlFichePersonne +'" title="'+ name +'">'+
+				'<img src="'+ urlPicture +'" alt="'+ name +'" />'+
+			'</a></li>';
+		$('#stars-more').append(itemStar);
+	});	
 
 
 
+});
+
+//-- picture
+var urlPicture = 'http://api.allocine.fr/rest/v3/picturelist?partner=B00015838755&subject=movie:135082';
+$.getJSON(urlPicture, function(data) {
+	var media = data.feed.media;
+	$.each(media, function(k, v){
+		var urlThumb = v.thumbnail.href;
+		console.log(urlThumb)
+	});
+});
 
 });
\ No newline at end of file