update workspace

This commit is contained in:
idea4good 2020-12-28 15:34:45 +08:00
parent f952d63e5d
commit 604904cbf8
2 changed files with 27 additions and 17 deletions

View File

@ -7,13 +7,6 @@ url="https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/
build_time=`date +%Y-%m-%dT%H:%M:%S.000%z`
device_info=`uname -s -n -m`
curl --include --request POST --header "Content-Type: application/json" --data-binary "[{
\"device_info\" :\"$device_info\",
\"project_info\" :\"$1\",
\"time\" :\"$build_time\",
\"weight\" :1
}]" $url > /dev/null
#--------------- Geo info ----------------#
curl ipinfo.io > ip_info.txt # get IP info
@ -32,6 +25,16 @@ sed -i 's/"org"://g' ip_org.txt #remove property name
sed -i 's/"//g' ip_org.txt #remove double quotes
org=`sed 's/,//g' ip_org.txt` #remove comma
curl --include --request POST --header "Content-Type: application/json" --data-binary "[{
\"device_info\" :\"$device_info\",
\"project_info\" :\"$1\",
\"time\" :\"$build_time\",
\"weight\" :1,
\"country\" :\"$country\",
\"city\" :\"$city\",
\"org\" :\"$org\"
}]" $url > /dev/null
url="https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/d6c4145f-2fdc-4071-94f7-fbdb090914d4/rows?key=pQ7GFsXkAqJij4v%2BadZDoth6HB%2BmjZbAn0d%2B%2BtlWnE3jpm1s0lGKoFeFV7aF1QQ7PKOYGpQYYCkS0tjzxTgbLQ%3D%3D"
curl --include --request POST --header "Content-Type: application/json" --data-binary "[{

View File

@ -1,4 +1,6 @@
echo off
SETLOCAL
set argC=0
for %%x in (%*) do Set /A argC+=1
if NOT "1" == "%argC%" (
@ -15,15 +17,6 @@ if not "%YY%" == "20" (rem For Chinese date format
set datetime=%YYYY%-%MM%-%DD%T%time: =0%0+0800
set devie_info=Win-%USERNAME%
set raw_data=[{^
\"device_info\" :\"%devie_info%\",^
\"project_info\" :\"%1\",^
\"time\" :\"%datetime%\",^
\"weight\" : 1^
}]
curl.exe --include --request POST --header "Content-Type: application/json" --data-binary^
"%raw_data%" "%url%"
rem ----------------- for GEO info -----------------
curl.exe ipinfo.io > ip_info.txt
@ -43,10 +36,24 @@ powershell -Command "(gc ip_org.txt) -replace '\"org\":', '' | Out-File -encodin
powershell -Command "(gc ip_org.txt) -replace '""' , '' | Out-File -encoding ASCII ip_org.txt"
powershell -Command "(gc ip_org.txt) -replace ',' , '' | Out-File -encoding ASCII ip_org.txt"
set url="https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/d6c4145f-2fdc-4071-94f7-fbdb090914d4/rows?key=pQ7GFsXkAqJij4v%%2BadZDoth6HB%%2BmjZbAn0d%%2B%%2BtlWnE3jpm1s0lGKoFeFV7aF1QQ7PKOYGpQYYCkS0tjzxTgbLQ%%3D%%3D"
set /p country=<ip_country.txt
set /p city=<ip_city.txt
set /p org=<ip_org.txt
set raw_data=[{^
\"device_info\" :\"%devie_info%\",^
\"project_info\" :\"%1\",^
\"time\" :\"%datetime%\",^
\"weight\" : 1,^
\"country\" :\"%country%\",^
\"city\" :\"%city%\",^
\"org\" :\"%org%\"^
}]
curl.exe --include --request POST --header "Content-Type: application/json" --data-binary^
"%raw_data%" "%url%"
set url="https://api.powerbi.com/beta/72f988bf-86f1-41af-91ab-2d7cd011db47/datasets/d6c4145f-2fdc-4071-94f7-fbdb090914d4/rows?key=pQ7GFsXkAqJij4v%%2BadZDoth6HB%%2BmjZbAn0d%%2B%%2BtlWnE3jpm1s0lGKoFeFV7aF1QQ7PKOYGpQYYCkS0tjzxTgbLQ%%3D%%3D"
set raw_data=[{^
\"county\" :\"%country%\",^
\"city\" :\"%city%\",^