-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
51 lines (46 loc) · 1.45 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
ini_set('display_errors',1);
spl_autoload_register(function($val){
require_once(__DIR__.'/lib/'.$val.'.php');
});
$number=isset($_POST['number'])?$_POST['number']:10;
$url='https://itunes.apple.com/jp/rss/topsongs/limit='.$number.'/xml';
$req=new ItunesRss($url);
$smenu=new SelectMenu(array('10'=>10,'25'=>25,'50'=>50,'100'=>100 ));
//echo '<pre>';
//print_r($req->getRequest());
//echo '</pre>';
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>itunesRsscustom</title>
</head>
<body>
<div class="container">
<div class="controll">
<form action="" method="post" id="number">
邦楽top
<select name="number" onChange="document.getElementById('number').submit()">
<?php
foreach($smenu->getoption() as $n=>$v):
if(isset($_POST['number']) && $n==$_POST['number']):
echo "<option value='".$n."' selected>".$v."</option>";
else:
echo "<option value='".$n."'>".$v."</option>";
endif;
endforeach;
?>
</select>
検索!
</form>
</div>
<?php $number=1;foreach($req->getRequest()->entry as $entry): ?>
<div class="item">
<h1><?= $number.'位:'.$entry->title ;?></h1>
</div>
<?php $number++;endforeach; ?>
</div>
</body>
</html>