Skip to content

Commit

Permalink
UPT: update division codes to Nov 2020
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperjiang committed Jan 5, 2021
1 parent 453a4a3 commit 19a4607
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ php:
- 7.2
- 7.3
- 7.4
- 8.0

notifications:
email: false
Expand Down
2 changes: 1 addition & 1 deletion src/DivisionCode/Upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function getCodes(): array
}

// need to redirect
if (preg_match('/http:\/\/www\.mca\.gov\.cn(\/)+article\/sj\/xzqh\/.+\.html/U', $html, $m)) {
if (preg_match('/http:\/\/(preview\.)?www\.mca\.gov\.cn(\/)+article\/sj\/xzqh\/.+\.html/U', $html, $m)) {
$html = file_get_contents($m[0]);
} else {
throw new \LengthException('Fail to parse redirect link');
Expand Down
Binary file modified src/DivisionCode/codes.db
Binary file not shown.
7 changes: 3 additions & 4 deletions src/DivisionCode/codes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1021,11 +1021,10 @@
340181 => '巢湖市',
340200 => '芜湖市',
340202 => '镜湖区',
340203 => '弋江区',
340207 => '鸠江区',
340208 => '三山区',
340221 => '芜湖县',
340222 => '繁昌县',
340209 => '弋江区',
340210 => '湾沚区',
340211 => '繁昌区',
340223 => '南陵县',
340281 => '无为市',
340300 => '蚌埠市',
Expand Down

0 comments on commit 19a4607

Please sign in to comment.