This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"birthday": "1970年9月27日(46歳)", | |
"birthplace": "埼玉県所沢市", | |
"image": "http://www.shogi.or.jp/images/player/pro/175.jpg", | |
"junni": "A級(A級以上:24期)", | |
"name": "羽生善治", | |
"no": "175", | |
"ryuou": "1組(1組以上:26期)" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
use Goutte\Client; | |
class Scraper { | |
protected $client; | |
public function __construct() { | |
$this->client = new Client(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'scraper.php'; | |
$scraper = new Scraper(); | |
$data = array(); | |
for ($i=1; $i<=308; $i++) { | |
$_kishi = $scraper->getKishi($i); | |
if ($_kishi) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$prefecture = array( | |
array('北海道', 0), | |
array('青森県', 0), | |
array('岩手県', 0), | |
array('宮城県', 0), | |
array('秋田県', 0), | |
array('山形県', 0), | |
array('福島県', 0), | |
array('茨城県', 0), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$key = 'xxxxxxxxxx'; | |
$data = file_get_contents("kishi_all.json"); | |
$data = json_decode($data); | |
$maps = array(); | |
foreach($data as $kishi) { | |
$result = file_get_contents('https://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($kishi->birthplace).'&key='.$key); | |
$result = json_decode($result, true); | |
if ($result['status'] != 'OK') { | |
continue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title></title> | |
<link rel="stylesheet" href="css/leaflet.css" /> | |
<script src="js/leaflet.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form> | |
<input type="text" id="search" placeholder="検索キーワードを入れてください"> | |
</form> | |
<table class="list" id="tabledata"> | |
<tbody> | |
<tr> | |
<th>棋士番号</th> | |
<th>氏名</th> | |
<th>出身地</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = file_get_contents("kishi_all.json"); | |
$data = json_decode($data); | |
$list = array(); | |
foreach ($data as $kishi) { | |
$length = mb_strlen($kishi->name, 'UTF-8'); | |
for($i=0; $i<$length; $i++) { | |
$char = mb_substr($kishi->name, $i, 1, 'UTF-8'); | |
if (isset($list[$char])) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// APIキー | |
$api_key = "Your API Key"; | |
// 画像パス | |
$image_path = "/path/to/image.jpg"; | |
// リクエスト用のJSONを作成 | |
$json = json_encode( array( | |
"requests" => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -name 'wp-load.php' -exec bash -c '_wp=$(echo {} | sed -e s/[^\/]*$//); echo -n "${_wp}: "; wp --path=${_wp} core verify-checksums || echo "WP not installed."' \; 2>/dev/null |