Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F10811088
API response size difference when removing detail and detailHTML
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Lucas_Werkmeister_WMDE
Nov 15 2017, 5:35 PM
2017-11-15 17:35:15 (UTC+0)
Size
613 B
Referenced Files
None
Subscribers
None
API response size difference when removing detail and detailHTML
View Options
json=$(
curl -G \
-d 'format=json' \
-d 'formatversion=2' \
-d 'action=wbcheckconstraints' \
-d 'id=Q64' \
https://www.wikidata.org/w/api.php
)
withDetail=$(
printf '%s' "$json" |
jq -c . |
wc -c
)
withoutDetail=$(
printf '%s' "$json" |
jq -c '
del(
.. |
objects |
select(has("constraint")) |
.constraint |
(.detail, .detailHTML)
)
' |
wc -c
)
awk \
-v "withDetail=$withDetail" \
-v "withoutDetail=$withoutDetail" \
'END {
removed = withDetail-withoutDetail
printf "%2.2f%%\n", 100 * removed / withDetail
}' < /dev/null
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5094260
Default Alt Text
API response size difference when removing detail and detailHTML (613 B)
Attached To
Mode
P6321 API response size difference when removing detail and detailHTML
Attached
Detach File
Event Timeline
Log In to Comment