12345678910111213141516171819 |
- #!/bin/bash
- api_key="22a685a51ad5fd3c317c953f287d6e6b169154804" #api_key
- api_token="a3db5c4a4f490c0b283c05ea1fc723551997627323" #api_token
- # project="cc" #projectId
- url="http://showdoc.seagine.com/server/?s=/api/open/fromComments"
- # mockurl="http://mock.seagine.com/api/fromComment"
- path=`grep -rl "\/\*\*" ./server/routes`
- for i in ${path}
- do
- txt=$(sed -n -e '/\/\*\*/,/\*\//p' $i)
- curl -s -o /dev/null -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' "${url}" --data-binary @- <<CURL_DATA
- from=shell&api_key=${api_key}&api_token=${api_token}&content=${txt}
- CURL_DATA
- # curl -s -o /dev/null -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' "${mockurl}" --data-binary @- <<CURL_DATA
- # from=shell&api_key=${api_key}&project=${api_key}&api_token=${api_token}&content=${txt}
- # CURL_DATA
- done
- echo over
|