Last active
January 13, 2021 20:30
-
-
Save maxlath/18ab1f0eaf5bf5201fd392d7bb988e45 to your computer and use it in GitHub Desktop.
Revisions
-
maxlath revised this gist
Jan 13, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ add_claim(){ uri=$1 property=$2 value=$3 curl -s -XPUT "https://inventaire.io/api/entities?action=update-claim" -H "Cookie: $INV_SESSION_COOKIES" -H "Content-Type: application/json" -d "{\"uri\":\"${uri}\",\"property\":\"${property}\",\"new-value\":\"${value}\"}" } add_publisher(){ -
maxlath revised this gist
Jan 13, 2021 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Use your username and password to get session cookies INV_USERNAME=foo INV_PASSWORD=bar INV_SESSION_COOKIES=$(curl -v 'https://inventaire.io/api/auth?action=login' -d "{\"username\":\"$INV_USERNAME\",\"password\":\"$INV_PASSWORD\"}" 2>&1 | grep 'Set-Cookie: inventaire:session' | awk '{print $3}' | xargs echo) @@ -14,4 +14,5 @@ add_publisher(){ inv_add_claim "$1" wdt:P123 "$2" } add_publisher inv:1b7b119485923797ed33e2fd292ae299 wd:Q1285349 add_publisher inv:3fdcb00a816ff62049c076960eef2080 wd:Q1285349 -
maxlath renamed this gist
Jan 13, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
maxlath created this gist
Jan 13, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ // Use your username and password to get session cookies INV_USERNAME=foo INV_PASSWORD=bar INV_SESSION_COOKIES=$(curl -v 'https://inventaire.io/api/auth?action=login' -d "{\"username\":\"$INV_USERNAME\",\"password\":\"$INV_PASSWORD\"}" 2>&1 | grep 'Set-Cookie: inventaire:session' | awk '{print $3}' | xargs echo) add_claim(){ uri=$1 property=$2 value=$3 curl -s -XPUT "$host/api/entities?action=update-claim" -H "Cookie: $INV_SESSION_COOKIES" -H "Content-Type: application/json" -d "{\"uri\":\"${uri}\",\"property\":\"${property}\",\"new-value\":\"${value}\"}" } add_publisher(){ inv_add_claim "$1" wdt:P123 "$2" } add_publisher inv:633835fc12ba489cdb202d0d63bde7d8 wd:Q1285349