Skip to content

Instantly share code, notes, and snippets.

@sinancan34
Last active November 18, 2018 17:24
Show Gist options
  • Save sinancan34/cfa6589c7cc1921a09b568f6a32005f8 to your computer and use it in GitHub Desktop.
Save sinancan34/cfa6589c7cc1921a09b568f6a32005f8 to your computer and use it in GitHub Desktop.
#!/bin/bash
while IFS=, read date country device page query clicks impressions ctr position
do
case $date in
("date") echo "skip" ;;
(*) curl -XPOST 'http://0.0.0.0:9200/search_console/property/?pretty' -H 'Content-Type: application/json' -d'
{
"date" : "'"$date"'",
"country" : "'"$country"'",
"device" : "'"$device"'",
"page" : "'"$page"'",
"query" : "'"$query"'",
"clicks" : '"$clicks"',
"impressions" : '"$impressions"',
"ctr" : '"$ctr"',
"position" : '"$position"'
}
' ;;
esac
done > property.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment