Bash script for POST request https xml-rpc to Gravatar

I have a project to collect user information with a local HTML file. The project must be cross-platform and portable (requires bash as git bash github). All collected data will be sent to the bash script using the previously configured protocol. Now I want to use bash to login to Gravatar using xml-rpc. I found this script

#! /bin/bash

# ping technorati

# configuration
ADDRESS="http://www.acooke.org/cute"
NAME="C[omp]UTE"
# (end of configuration)

export PATH="$PATH:$CUTE_DIR/scripts"

tmp=`mktemp`
echo "<?xml version=\"1.0\"?>
<methodCall>
  <methodName>weblogUpdates.ping</methodName>
  <params>
    <param>
      <value>$NAME</value>
    </param>
    <param>
      <value>$ADDRESS</value>
    </param>
  </params>
</methodCall>" > "$tmp"

size=`cat "$tmp" | wc -c`

msg=`mktemp`
echo "POST /rpc/ping HTTP/1.0
User -Agent: bash script across netcat - andrew@...
Host: rpc.technorati.com
Content-Type: text/xml
Content-length: $size
" > "$msg"

cat "$tmp" >> "$msg"
rm "$tmp"
cat "$msg"
cat "$msg" | nc rpc.technorati.com 80
rm "$msg"

      

Wondering how to convert this to https for Gravatar?

+3


source to share





All Articles