質問編集履歴
5
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,4 +2,4 @@
|
|
2
2
|
どうすれば、YOLPの情報を文字列としてではなく、一つ一つの店舗として表示する事が出来ますか?
|
3
3
|
分かりにくい説明ですみません。例として挙げるなら、ホットペッパーや食べログみたいな店舗表示を目指しています。
|
4
4
|
因みに私が書いたphpコードは下記に掲載しました。 phpとwebapiの知識が全くないため、間違っているところがあると思います。 ご教授、お願いします
|
5
|
-
<?php /* Template Name: takeout */ ?> <?php if(have_posts()): while(have_posts()): the_post();?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endwhile; endif; ?> <!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>YOLP</title> <head> <body> <?php $id = '私のid'; $area= 13; $ct ='0114'; $start = '1'; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=100&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); $total = $xml ->ResultInfo->Total; $loop = (int)($total/100); $i = 0; while($i <= $loop){ $start = 100*$i+1; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=200&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); foreach($xml->Feature as $item){ echo $item->Name. ',' . $item->Property->Yomi .',' . $item->Property->Tel1 . ',' . $item->Property->Address . ',' . $item->Property->Station->Railway . $item->Property->Station->Name . '駅' .$item->Property->Detail->OfficialPcUrl1; echo '<br />'; } $i++; } ?>
|
5
|
+
<?php /* Template Name: takeout */ ?> <?php if(have_posts()): while(have_posts()): the_post();?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endwhile; endif; ?> <!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>YOLP</title> <head> <body> <?php $id = '私のid'; $area= 13; $ct ='0114'; $start = '1'; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=100&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); $total = $xml ->ResultInfo->Total; $loop = (int)($total/100); $i = 0; while($i <= $loop){ $start = 100*$i+1; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=200&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); foreach($xml->Feature as $item){ echo $item->Name. ',' . $item->Property->Yomi .',' . $item->Property->Tel1 . ',' . $item->Property->Address . ',' . $item->Property->Station->Railway . $item->Property->Station->Name . '駅' .$item->Property->Detail->OfficialPcUrl1; echo '<br />'; } $i++; } ?>
|
4
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
3
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
yahooのwebapi(厳密にはYOLPです)のphpファイルをpage-スラッグ名.phpとして保存し、固定ページとして投稿する事が出来ましたが、いざYOLPのphpファイルの固定ページを開くと、YOLPの情報が文字列で表示されます。(localhostのmampのindex ofにphpファイルを入れて表示する時と同じです)
|
2
2
|
どうすれば、YOLPの情報を文字列としてではなく、一つ一つの店舗として表示する事が出来ますか?
|
3
3
|
分かりにくい説明ですみません。例として挙げるなら、ホットペッパーや食べログみたいな店舗表示を目指しています。
|
4
|
-
因みに私が書いたphpコードは下記に掲載しました。 phpとwebapiの知識が全くないため、間違っているところがあると思います。 ご教授、お願いします
|
5
|
-
|
4
|
+
因みに私が書いたphpコードは下記に掲載しました。 phpとwebapiの知識が全くないため、間違っているところがあると思います。 ご教授、お願いします
|
5
|
+
<?php /* Template Name: takeout */ ?> <?php if(have_posts()): while(have_posts()): the_post();?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endwhile; endif; ?> <!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>YOLP</title> <head> <body> <?php $id = '私のid'; $area= 13; $ct ='0114'; $start = '1'; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=100&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); $total = $xml ->ResultInfo->Total; $loop = (int)($total/100); $i = 0; while($i <= $loop){ $start = 100*$i+1; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=200&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); foreach($xml->Feature as $item){ echo $item->Name. ',' . $item->Property->Yomi .',' . $item->Property->Tel1 . ',' . $item->Property->Address . ',' . $item->Property->Station->Railway . $item->Property->Station->Name . '駅' .$item->Property->Detail->OfficialPcUrl1; echo '<br />'; } $i++; } ?>'''
|
2
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
yahooのwebapi(厳密にはYOLPです)のphpファイルをpage-スラッグ名.phpとして保存し、固定ページとして投稿する事が出来ましたが、いざYOLPのphpファイルの固定ページを開くと、YOLPの情報が文字列で表示されます。(localhostのmampのindex ofにphpファイルを入れて表示する時と同じです)
|
2
2
|
どうすれば、YOLPの情報を文字列としてではなく、一つ一つの店舗として表示する事が出来ますか?
|
3
3
|
分かりにくい説明ですみません。例として挙げるなら、ホットペッパーや食べログみたいな店舗表示を目指しています。
|
4
|
-
因みに私が書いたphpコードは下記に掲載しました。 phpとwebapiの知識が全くないため、間違っているところがあると思います。 ご教授、お願いします。
|
4
|
+
因みに私が書いたphpコードは下記に掲載しました。 phpとwebapiの知識が全くないため、間違っているところがあると思います。 ご教授、お願いします。
|
5
|
+
''' <?php /* Template Name: takeout */ ?> <?php if(have_posts()): while(have_posts()): the_post();?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endwhile; endif; ?> <!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>YOLP</title> <head> <body> <?php $id = '私のid'; $area= 13; $ct ='0114'; $start = '1'; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=100&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); $total = $xml ->ResultInfo->Total; $loop = (int)($total/100); $i = 0; while($i <= $loop){ $start = 100*$i+1; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=200&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); foreach($xml->Feature as $item){ echo $item->Name. ',' . $item->Property->Yomi .',' . $item->Property->Tel1 . ',' . $item->Property->Address . ',' . $item->Property->Station->Railway . $item->Property->Station->Name . '駅' .$item->Property->Detail->OfficialPcUrl1; echo '<br />'; } $i++; } ?>'''
|
1
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,3 +1,4 @@
|
|
1
1
|
yahooのwebapi(厳密にはYOLPです)のphpファイルをpage-スラッグ名.phpとして保存し、固定ページとして投稿する事が出来ましたが、いざYOLPのphpファイルの固定ページを開くと、YOLPの情報が文字列で表示されます。(localhostのmampのindex ofにphpファイルを入れて表示する時と同じです)
|
2
2
|
どうすれば、YOLPの情報を文字列としてではなく、一つ一つの店舗として表示する事が出来ますか?
|
3
|
-
分かりにくい説明ですみません。例として挙げるなら、ホットペッパーや食べログみたいな店舗表示を目指しています。
|
3
|
+
分かりにくい説明ですみません。例として挙げるなら、ホットペッパーや食べログみたいな店舗表示を目指しています。
|
4
|
+
因みに私が書いたphpコードは下記に掲載しました。 phpとwebapiの知識が全くないため、間違っているところがあると思います。 ご教授、お願いします。 <?php /* Template Name: takeout */ ?> <?php if(have_posts()): while(have_posts()): the_post();?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endwhile; endif; ?> <!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>YOLP</title> <head> <body> <?php $id = '私のid'; $area= 13; $ct ='0114'; $start = '1'; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=100&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); $total = $xml ->ResultInfo->Total; $loop = (int)($total/100); $i = 0; while($i <= $loop){ $start = 100*$i+1; $url = 'http://search.olp.yahooapis.jp/OpenLocalPlatform/V1/localSearch?appid='.$id.'&ac='.$area.'&gc='.$ct.'&results=200&start='.$start.'&detail=full'; $xml = simplexml_load_file( $url ); foreach($xml->Feature as $item){ echo $item->Name. ',' . $item->Property->Yomi .',' . $item->Property->Tel1 . ',' . $item->Property->Address . ',' . $item->Property->Station->Railway . $item->Property->Station->Name . '駅' .$item->Property->Detail->OfficialPcUrl1; echo '<br />'; } $i++; } ?>
|