-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathREADME
34 lines (24 loc) · 907 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
按照编程兄🐻的要求,特放上此README。
courtesy of @aoxiangwu:
我写了个脚本获取index.html的日期
希望能加到你的http://readme.md 里面,不然readme太空了
nodejs版本
get.js
https://github.com/aoxiangwu/get/blob/master/get.js
require('https').get('https://raw.githubusercontent.com/posclegom/programthink/master/index.html', (resp) => {
resp.setEncoding('utf8');
resp.on('data', (chunk) => {
console.log(chunk.match(/\d\d\d\d-\d\d-\d\d/)[0]);
process.exit();
});
}).on("error", (err) => {
console.log("Error: " + err.message);
});
Python版本 获取离线博客制作日期
get.py
https://github.com/aoxiangwu/get/blob/master/get.py
from requests import get
from bs4 import BeautifulSoup as Bs
url = 'https://raw.githubusercontent.com/posclegom/programthink/master/index.html'
html = Bs(get(url).text, 'html.parser')
print(html.select('b')[0])