Skip to content

Commit

Permalink
4.3:修复Pixiv排行榜页面代码改版导致的无法更新;跳转至详情页时使用 https
Browse files Browse the repository at this point in the history
  • Loading branch information
mokeybug committed Sep 27, 2019
1 parent 91715d6 commit 736a31c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
- 本项目免费开源,仅供学习交流。请勿用于任何商业用途,作者不承担任何责任

## 更新日志
### 4.3
- 修复Pixiv排行榜页面代码改版导致的无法更新
- 跳转至详情页时使用 https

### 4.2
- 修复Pixiv排行榜页面代码改版导致的无法更新
- 添加获取排行榜失败时的最大重试次数
Expand Down
2 changes: 1 addition & 1 deletion app/Libs/Pixiv.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static function getImageList()

$html = Curl::get('https://www.pixiv.net/ranking.php?mode=daily&content=illust');
preg_match_all('|https://i\.pximg\.net/c/240x480/img-master/img/\d{4}/\d{2}/\d{2}/\d{2}/\d{2}/\d{2}/.*?\.\w{3}|', $html, $image); // 匹配缩略图url
preg_match_all('|<a href="/(member_illust.php\?mode=medium&amp;illust_id=\d+)"class="title"|', $html, $url); // 匹配链接
preg_match_all('|<a href="/(artworks/\d+)"class="title"|', $html, $url); // 匹配链接

// 如果获取图片或url失败
if (empty($image[0]) || empty($url[1]))
Expand Down
2 changes: 1 addition & 1 deletion app/Views/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<?php foreach ($pixivJson['image'] as $k => $v): ?>
<?php if ($k >= Config::$limit) break; ?>
<div class="item <?php if ($k == 0) echo 'active'; ?>">
<a href="http://www.pixiv.net/<?= $pixivJson['url'][$k] ?>" target="_blank">
<a href="https://www.pixiv.net/<?= $pixivJson['url'][$k] ?>" target="_blank">
<div class="carousel-caption" style="background-image: url(<?= str_replace('http://i', '//i', $v) ?>)"></div>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* 项目:Pixiv每日排行榜Top50小部件
* 版本:4.2
* 版本:4.3
* 作者:超能小紫(mokeyjay)
* 博客:https://www.mokeyjay.com
* 源码:https://github.com/mokeyjay/Pixiv-daily-top50-widget
Expand Down

0 comments on commit 736a31c

Please sign in to comment.