当前位置:网站首页>PIXIV Gizmo
PIXIV Gizmo
2022-06-24 21:12:00 【The smell of tobacco】
Preface
Recently I saw a big man , Open source a small blog plug-in , Address . Can be pixiv
The daily list of the website is put in the blog sidebar . It looks cool . So I also introduced it into my blog . I would like to express my thanks to the boss .
But in use , It is often encountered that the access is very slow , After checking, I found , The big guy's server is set up in Korea , No wonder access is slow , It's all international bandwidth .
therefore , I just built one in Beijing , If necessary, it can be introduced by itself . The effect can be Home page see . Address : https://fun.hujingnb.com/pixiv/i
Use
I'm using WordPress
, So WordPress
For example , Please handle other situations by yourself . The click effect of the current image is to open the original image .
Add sidebar HTML Control , Content (iframe
Please modify ):
<iframe src="https://fun.hujingnb.com/pixiv/i" frameborder="0" style="width:300px; height:400px;" ></iframe>
in addition , I added a few requested GET
Parameters , It is used for customization of small partners in need .
interval
: Page rotation duration ( millisecond ). Default5000
bg
: Background color , Defaulttransparent
w
: Image width . Default300
- Because many of the pictures on the daily list exceed
1MB
, Therefore, the image is compressed , Can improve access speed . - Optional value :
100, 200, 300, 400, 500
.
- Because many of the pictures on the daily list exceed
limit
: Ranking range of rotation training . Default1,50
1,50
Show rankings for 1-50 Pictures of the- The biggest ranking
100
, For the time being100
It should be enough , So we only took the Japanese list top 100
principle
At the beginning , I was thinking about the project down Come down , Just configure it to run , however , After reading the source code , I find that I can't use many functions of others , I just need a crawler and a presentation page . I just wrote a .
The implementation is very simple , Here is a brief introduction , No more open source , There are only a few lines .
A presentation page , from oss Read pictures from the fixed path of the . Like ranking 1 Of , Path is : pixiv/1.jpg
.
A script that executes regularly every day , Download and overwrite the latest pictures oss File contents of . To save money , When the download is complete ecs release . Specific to see Alibaba cloud schedules tasks and automatically releases them . meanwhile , Because the page uses cdn Read the picture , So after downloading , To refresh the next cdn cache .
be without , That's all . Of course , Now there are still some problems , such as :
- If the scheduled script is executed , The daily leaderboard has not been refreshed , Lack of retry mechanism
- The page can only read pictures url, Unable to read more information , Lack of data communication
- If there is no picture of a ranking on that day , The page doesn't know , There will still be demonstrations . ( Because it is a file overwrite , You can still read old files )
- wait
However, the current requirements are not high , These problems are tolerable .
边栏推荐
- VIM usage
- What are the problems with traditional IO? Why is zero copy introduced?
- [multi thread performance tuning] multi thread lock optimization (Part 1): optimization method of synchronized synchronization lock
- JUnit unit test
- Use the transparent [x] cross button image in the dialog
- JMeter basic learning records
- Simulation lottery and probability statistics experiment of the top 16 Champions League
- Leetcode (135) - distribute candy
- Power apps Guide
- More than ten years' work experience is recommended at the bottom of the box: how much does it cost to find a job? See here! Brothers and sisters are recommended to collect and pay attention
猜你喜欢
Rip/ospf protocol notes sorting
Haitai Advanced Technology | application of privacy computing technology in medical data protection
When querying the database with Gorm, reflect: reflect flag. mustBeAssignable using unaddressable value
VMware virtual machine setting static IP
The difference between RPC and restful
Basic concepts and definitions of Graphs
Sequential stack traversal binary tree
Learn to use a new technology quickly
Combination mode -- stock speculation has been cut into leeks? Come and try this investment strategy!
JMeter basic learning records
随机推荐
Pytest testing framework
Simulation lottery and probability statistics experiment of the top 16 Champions League
Image panr
Dx12 engine development course progress - where does this course go
Design of routing service for multi Activity Architecture Design
Several common command operations in win system
Docker deploy mysql5.7
2021-09-30
Camera rental management system based on qt+mysql
Record a deletion bash_ Profile file
Why do we always "give up halfway"?
Memo mode - game archiving
海泰前沿技术|隐私计算技术在医疗数据保护中的应用
Popupwindow touch event transparent transmission scheme
JMeter response assertion
Prototype mode -- clone monster Army
(to be optimized and modified) vivado DDR4 SDRAM (MIG) (2.2) IP core learning record
go_ keyword
Am, FM, PM modulation technology
Power apps Guide