-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from mokeyjay/develop
更新英文文档
- Loading branch information
Showing
5 changed files
with
176 additions
and
46 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/.idea | ||
.DS_Store |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
# Deployment | ||
- [Download source code](https://github.com/mokeyjay/Pixiv-daily-ranking-widget/releases/latest) | ||
- Unzip to the web directory | ||
- Edit `config.php` with a professional editor (e.g. `Visual Studio Code`, `Sublime`, etc., notepad is not allowed) and modify the configuration accordingly | ||
- Give write permission to `storage` directory | ||
- Unzip under your the web directory | ||
- Edit `config.php` with a **professional** editor (e.g. `Visual Studio Code`, `Sublime`, etc., notepad is not allowed) and modify the configuration according to your own needs | ||
- Grant write permission to `storage` directory | ||
|
||
## Proactively trigger updates | ||
By default, this widget will check if the ranking data is out of date every time it is accessed and make an additional request to trigger an automatic update if needed. Usually no intervention is required | ||
## Trigger updates proactively | ||
By default, this widget will check if the ranking data is out of date every time it is accessed and make an additional request to trigger an automatic update if needed. In most cases, this operation is not required. | ||
|
||
However, in some cases (e.g. PHP timeouts are not long enough, server performance is low), this web-triggered update is interrupted before it finishes, which not only causes the update to never finish, but also keeps wasting performance and bandwidth. | ||
If you encounter the same problem, you can turn off web-triggered updates (set `disable_web_job` to `false` in `config.php`) | ||
However, in some cases (e.g. PHP timeouts are not long enough, server performance is too poor), this web-triggered update will be interrupted before it finishes. This will interrupt the update and never let it finish, and also keeps consuming unnecessary performance and bandwidth. | ||
If you encounter the problem above, you can turn off web-triggered updates (set `disable_web_job` to `false` in `config.php`) | ||
Then trigger update proactively via cli, e.g. `php index.php -j=refresh` | ||
|
||
> You can use a tool like `crontab` to automatically trigger updates on a regular basis. For example `*/30 * * * * php /path/to/pixiv/index.php -j=refresh` | ||
> It means run update every 30 minutes. The program will automatically determine whether it really needs to be updated, and it won't waste performance | ||
## Clear the log at regular intervals | ||
Opening the log (set `log_level` to `['DEBUG', 'ERROR']` in `config.php`) will log this widget's running info | ||
When giving me feedback on a problem, it is also usually recommended to send me the logs and configuration file as a package (please do not post the configuration file to the public) | ||
If you are going to keep the log open for a long time and are worried about it taking up too much hard drive, you can delete the 7 day old log with `php index.php -j=clear-log` | ||
Opening the log (set `log_level` to `['DEBUG', 'ERROR']` in `config.php`) will log this widget's running info. | ||
When giving me feedback on a problem, it is usually recommended to send me the logs and configuration file as a zip package (please do not post the configuration file to the public) | ||
If you are going to keep the log enabled for a long time and are worried about it taking up too much hard drive, you can delete the logs over 7 days with `php index.php -j=clear-log` | ||
|
||
> Add the parameter `-n=3` to delete logs that are 3 days old | ||
> You can use a tool like `crontab` to delete automatically on a regular basis. For example `30 1 * * * php /path/to/pixiv/index.php -j=clear-log` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,126 @@ | ||
# History Update Log | ||
*There are so many history logs that I am too lazy to translate them* | ||
### 4.4.2 | ||
|
||
- Update default UA of Curl class | ||
- Remove invalid image host | ||
- Update Alibaba image host | ||
- Add `disable_web_job` switch, see `config.php` for details | ||
|
||
### 4.4.1 | ||
|
||
- Update default UA of Curl class | ||
- Fix an error of getting wrong project URL in some cases | ||
- Fix the retry loop when fails to get ranking data. | ||
- Optimize the logic to determine whether the data needs to be updated | ||
- Delete the obsolete Alibaba image host | ||
|
||
### 4.4 | ||
|
||
- Use official ajax interface to get ranking data | ||
- Add Alibaba, Baidu, toutiao.com image host API | ||
- Update smms image host API to v2 version | ||
- Remove deprecated img.sb image host API | ||
- Remove unaccessible Jingdong image host API | ||
- Remove statistics code on loading page | ||
- Use comprehensive ranking data instead of just illustrations rank | ||
- Expanded maximum number of returned images to 500, corresponding to the official limit | ||
- The value of `service` configuration item no longer affects the limit. | ||
- Other optimizations and bug fixes | ||
|
||
### 4.3 | ||
|
||
- Fix failed to update the Pixiv ranking page due to pixiv change. | ||
- Use https when jumping to detail page | ||
|
||
### 4.2 | ||
|
||
- Fix failed to update the Pixiv ranking page due to pixiv change. | ||
- Add a maximum number of retries if failing to get the ranking data. | ||
|
||
### 4.1 | ||
|
||
- Support transparent background | ||
|
||
### 4.0 | ||
|
||
- New version with almost all the codes rewritten, more new features and bugs for you to discover! | ||
- Since pixiv has enabled global anti-hotlink, the `download` and `url_cache` options have been removed. Now it will force download thumbnails, and then upload them to the corresponding image host or store them locally on the server according to the configuration | ||
|
||
> Mumbling: I initially stated this project just for fun, and never expected the code to get so ugly as features piled up. It's so shameful that this project became my most starred project on GitHub. Luckily I spent some days to deal with the 4.0 version, and it feels better now. | ||
> | ||
> BTW this little thing now supports multiple image host, it will save hundreds of gigs of traffic every month now yingyingying | ||
### 3.0 | ||
|
||
- Add `$download_proxy` configuration option | ||
- Since Pixiv's has enabled anti-hotlink and images cannot be displayed directly, `$download` is enabled by default. | ||
For better display, self-deployed users are recommended to configure a timed task to trigger `download.php` at 0:00 every day | ||
|
||
### 2.9 | ||
|
||
- Fix the problem of not functioning normally due to Pixiv changes | ||
|
||
### 2.8 | ||
|
||
- Try to optimize update lock to prevent repeated updates under high concurrency | ||
- Separate the configuration item `Conf::$url_cache` from `Conf::$download`, now you can only cache the image url instead of the thumbnail url | ||
- Add support for tietuku.cn image host | ||
|
||
> The free version of tietuku.cn is not very good and does not support https, I suggest using sm.ms first and tietuku.cn only as a fallback option. | ||
> Due to some problems with the previous update lock not working well under high concurrency, my server IP was blocked by sm.ms image host due to duplicate uploads. And I personally can't afford to support the high CDN cost. <del>So effective immediately **Plan One** no longer provides official CDN acceleration and instead gets images directly from the Pixiv site</del | ||
> Plan 1 is currently supported by 360 Site Defender CDN | ||
### 2.7 | ||
|
||
- Add image compression feature to reduce server bandwidth stress (requires GD library) | ||
- Fix sm.ms image host support to reduce chances to fail | ||
- Add sm.ms image host upload log | ||
|
||
> If there is a problem with opening `$enable_smms`, please paste the log file when giving feedback | ||
### 2.6 | ||
|
||
- Add sm.ms image host support. With one click to enable, it can significantly reduce the server bandwidth stress and save traffic. Thanks to [@Showfom](https://sb.sb/) for providing the image host | ||
|
||
> I'm not going to tell you that I added this feature because it hurts that the several gigabytes of traffic will be consumed every day on Plan 1 | ||
> If the upload fails 3 times repeatedly, image will be read locally from the server to ensure normal access | ||
### 2.5 | ||
|
||
- Fix the problem of not functioning normally due to Pixiv changes | ||
- Pixiv supports native https now! Hooray! | ||
|
||
### 2.4 | ||
|
||
- Fix the problem that the `limit` parameter of URL is invalid under certain circumstances | ||
- Repair the caching problem of **Plan 1** | ||
- Fix the SSL certificate problem | ||
|
||
### 2.3 | ||
|
||
- Replace the reference url of front-end library, fix the problem of slow loading with China Mobile as ISP | ||
- Add adaptive protocol feature, fix the problem of the small green lock being affected when the cache is disabled or the cache peogress is not finished | ||
- The above update comes from the friendly PR of @LingWuLuKong, let's PRPR her together to show our appreciation! | ||
- The Plan One from mokeyJay a service now supports HTTPS. The CDN charge is high, please use and cherish! | ||
- If it is abused to the point that I can not afford the cost, then the service may be suspended~ | ||
- If the number of visits is high, it is recommended to build your own services, thank you for your support and understanding! | ||
|
||
### 2.2 | ||
|
||
- Optimize download threads to support self-deployed HTTPS | ||
|
||
### 2.1 | ||
|
||
- I must be drunk when planning the 2.0 roadmap to constrain all logic into one file. Although the overall performance has been improved, the same problems still occur in some cases. For example, the thumbnail will fail to download, PHP will timeout so the download will break, and so on. So when I tested it and realized this, I started working on a new version <del>Facepalm</del>. | ||
- Remove the auto update lock mechanism, the thumbnails will no longer be re-downloaded when they already exist and are valid. Prevents thumbnail download failures due to network fluctuations or timeouts | ||
|
||
### 2.0 | ||
|
||
- Overall refactoring, overall performance is greatly optimized | ||
- Add an automatic update lock mechanism to avoid wasting resources on concurrent updates under high concurrency scenario | ||
- New pseudo multi-thread automatic update mechanism, background update does not affect widget use | ||
- Update failure retrial, to avoid the failure of retrieving some images due to network problems | ||
|
||
## Motivations | ||
|
||
I was talking to a friend the other day, and he said he wanted to show the daily ranking of [Pixiv](http://www.pixiv.net/) in the sidebar of his blog. I am also an `ACG` lover myself, so I wanted to write this as well. I finally had time last night and spent more than half an hour writing it. It looks great on [my own blog](https://www.mokeyjay.com), so I polished it and added some features and made it open source in case you have the same requirements. |