提取不蒜子访问数据

不蒜子老是抽风,所以我换到了leancloud上,但是之前的数据我希望保留。

该如何提取不蒜子上面的数据呢?

目前找到的有效方法就是直接模拟访问的方式获取每个网页的数据

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# !/bin/bash

pushd /tmp
wget https://feater.top/sitemap.xml

xmllint --xpath '////*[local-name()="urlset"]/*[local-name()="url"]/*[local-name()="loc"]/text()' sitemap.xml > /tmp/url
sort -u /tmp/url > /tmp/list

search()
{
echo ${1} >> /tmp/res
curl -H "Referer: ${1}" -X GET "http://busuanzi.ibruce.info/busuanzi?jsonpCallback=BusuanziCallback_1046609647591" >> /tmp/res
echo >> /tmp/res
sleep 1
}

export -f search

parallel -j 1 'search {}' :::: /tmp/list

awk '(NR%2) {printf("%s\t", $0)} (NR%2!=1) {system("cut -d: -f3 <<< \"" $0 "\"| cut -d, -f1")}' /tmp/res > /tmp/res-num

sort -k2nr /tmp/res-num | head -n20

执行的时候要

1
./get_data.sh

说明

  • sitemap中没有的自然就无法获取。

提取不蒜子访问数据
https://feater.top/data/how-to-get-busuanzi-data/
作者
JackeyLea
发布于
2024年1月14日
许可协议