showdoc.sh 868 B

12345678910111213141516171819
  1. #!/bin/bash
  2. api_key="2165c23beeefb43294144565ebd198f11018673352" #api_key
  3. api_token="ffe10497bdf584cda150fba861341283661026723" #api_token
  4. # project="cc" #projectId
  5. url="http://showdoc.seagine.com/server/?s=/api/open/fromComments"
  6. # mockurl="http://mock.seagine.com/api/fromComment"
  7. path=`grep -rl "\/\*\*" ./server/routes`
  8. for i in ${path}
  9. do
  10. txt=$(sed -n -e '/\/\*\*/,/\*\//p' $i)
  11. curl -s -o /dev/null -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' "${url}" --data-binary @- <<CURL_DATA
  12. from=shell&api_key=${api_key}&api_token=${api_token}&content=${txt}
  13. CURL_DATA
  14. # curl -s -o /dev/null -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' "${mockurl}" --data-binary @- <<CURL_DATA
  15. # from=shell&api_key=${api_key}&project=${api_key}&api_token=${api_token}&content=${txt}
  16. # CURL_DATA
  17. done
  18. echo over