https://github.com/helloxz/v2ex-luck
V2EX楼层抽奖
https://github.com/helloxz/v2ex-luck
Last synced: 3 months ago
JSON representation
V2EX楼层抽奖
- Host: GitHub
- URL: https://github.com/helloxz/v2ex-luck
- Owner: helloxz
- Created: 2022-04-08T05:26:15.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-08T05:57:52.000Z (about 4 years ago)
- Last Synced: 2025-07-21T11:45:48.495Z (11 months ago)
- Size: 30.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# v2ex-luck
V2EX T楼抽奖
## 使用方法
首先通过浏览器F12工具获取HTML节点,

```html
...
```
然后将HTML内容存到一个文本中,比如`v2ex.txt`
最后使用shell随机抽取3名幸运用户:
```bash
grep -oh 'member/.*' v2ex.txt|grep -v "xiaoz"|grep -v "@"|grep -oh ">[a-zA-Z0-9]*<"|grep -o "[a-zA-Z0-9]*"|uniq|shuf -n3
```
1. 正则筛选出所有楼层用户
2. 去除自己的楼层账号`xiaoz`
3. `uniq`去重重复楼层的用户
4. `shuf`随机抽取3行作为幸运用户
