-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
75 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# alfred-workflow-ipip base on ipip.net | ||
|
||
an IP query plugin for alfred-workflow(2/3) without any dependence | ||
|
||
data is from [ipip.net](https://www.ipip.net/) | ||
|
||
|
||
# download | ||
|
||
|
||
|
||
# how to use | ||
|
||
key work: ip | ||
|
||
ip 8.8.4.4 | ||
|
||
ip ximalaya.com | ||
|
||
## screenshots | ||
|
||
![1](screenshots/1.png) | ||
|
||
![2](screenshots/2.png) | ||
|
||
![3](screenshots/3.png) |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
|
||
ip='{query}' | ||
|
||
result=$(curl -s https://www.ipip.net/ip.html -H "User-Agent: Safari/537.36" -H "Referer: https://www.ipip.net/ip.html" --data "ip=${ip}" --compressed) | ||
|
||
/bin/echo '<?xml version="1.0"?>' | ||
/bin/echo '<items>' | ||
|
||
address=`echo "$result" | grep '<div><span id=\"myself\">' -A 1 |tail -n 1| sed "s/<\/span>//g" | sed "s/ //g"` | ||
|
||
info=`echo "$result" |grep '<td style=\"text-align: center;\">' | sed -e 's/<[^>]*>//g' | sed "s/ //g" | sed "s/购买此数据//g" |sed "s/(更多数据请购买付费IP库)//g"` | ||
|
||
# echo $address | ||
# echo $info | ||
|
||
if [[ ! -z "$address" ]]; then | ||
uid=`echo $address | md5 | awk '{print $1}'` | ||
echo '<item uid="'$uid'" arg="'$address'">' | ||
echo '<title>'$address'</title>' | ||
echo '<subtitle>ipip.net 数据</subtitle>' | ||
echo '<icon>icon.png</icon>' | ||
echo '</item>' | ||
fi | ||
|
||
if [[ ! -z "$info" ]]; then | ||
uid=`echo $address | md5 | awk '{print $1}'` | ||
echo '<item uid="'$uid'" arg="'$info'">' | ||
echo '<title>'$info'</title>' | ||
echo '<subtitle>IDC 猜测</subtitle>' | ||
echo '<icon>icon.png</icon>' | ||
echo '</item>' | ||
fi | ||
|
||
|
||
# rtb-asia | ||
rtbresult=$(curl -s "https://ip.rtbasia.com/webservice/ipip?ipstr=${ip}" -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Accept-Language: zh-CN,zh;q=0.8' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Referer: https://www.ipip.net/ip.html' -H 'Cache-Control: max-age=0' --compressed | grep '真人概率' | sed -e 's/<[^>]*>//g' | sed -e 's/ //g' |sed "s/ //g"|sed "s/ //g") | ||
|
||
# echo "$rtbresult" | ||
|
||
if [[ ! -z "$rtbresult" ]]; then | ||
uid=`echo $rtbresult | md5 | awk '{print $1}'` | ||
echo '<item uid="'$uid'" arg="'$rtbresult'">' | ||
echo '<title>'$rtbresult'</title>' | ||
echo '<subtitle>RTBAsia非人类访问量甄别服务</subtitle>' | ||
echo '<icon>icon.png</icon>' | ||
echo '</item>' | ||
fi | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.