Return to Snippet

Revision: 26297
at April 22, 2010 15:11 by Mosaic


Updated Code
<?
	$video = "5144569";
	$xml_data =  @file_get_contents("http://vimeo.com/api/clip/".$video.".xml");
	$parser = xml_parser_create('UTF-8');
	xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); 
	xml_parse_into_struct($parser, $xml_data, $vals, $index); 
	xml_parser_free($parser);
	
	$thumb_index = $index['STATS_NUMBER_OF_PLAYS'][0]; //restituisce l'indice dell'array che contiene le stats
	$n_views = $vals[$thumb_index]['value'];
	echo $n_views;
?>

Revision: 26296
at April 22, 2010 15:10 by Mosaic


Updated Code
<?
	$video = "5144569";
	$xml_data =  @file_get_contents("http://vimeo.com/api/clip/".$video.".xml");
	$parser = xml_parser_create('UTF-8');
	xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); 
	xml_parse_into_struct($parser, $xml_data, $vals, $index); 
	xml_parser_free($parser);
	
	$thumb_index = $index['STATS_NUMBER_OF_PLAYS'][0]; //restituisce l'indice dell'array che contiene le stats
	$n_views = $vals[$thumb_index]['value'];
	echo $thumb_views ;
?>

Revision: 26295
at April 22, 2010 15:08 by Mosaic


Initial Code
<?
	$video = "5144569";
	$xml_data =  @file_get_contents("http://vimeo.com/api/clip/".$video.".xml");
	$parser = xml_parser_create('UTF-8');
	xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); 
	xml_parse_into_struct($parser, $xml_data, $vals, $index); 
	xml_parser_free($parser);
	
	$thumb_index = $index['STATS_NUMBER_OF_PLAYS'][0]; //restituisce l'indice dell'array che contiene le stats
	$thumb_url = $vals[$thumb_index]['value'];
	echo $thumb_url;
?>

Initial URL


Initial Description


Initial Title
Vimeo video number of views

Initial Tags
xml

Initial Language
PHP