Hi,
I have been using the bash script below with oauth libs in linux to post automatic updates of my (b)logs for months now…until last Tuesday (10th Dec) that is. Since then no tweets have appeared. I have looked on the forums for an answer, with no joy. Has anything been modified lately that requires my code to be updated? Has my API token expired? Any ideas would be welcome.
Thank you
Greg
#!/bin/bash
source /usr/sbin/OAuth.sh
TCLI_RC="/var/www/html/twitter/authStuff"
T_STATUSES_UPDATE=“https://api.twitter.com/1.1/statuses/update.json”
[[ -f “$TCLI_RC” ]] && . “$TCLI_RC”
#echo $oauth_token
status="$@"
echo $status
oauth_signature_method='HMAC-SHA1’
oauth_version='1.0’
params=(
$(OAuth_param ‘oauth_consumer_key’ “$oauth_consumer_key”)
$(OAuth_param ‘oauth_signature_method’ “$oauth_signature_method”)
$(OAuth_param ‘oauth_version’ “$oauth_version”)
$(OAuth_param ‘oauth_nonce’ “$(OAuth_nonce)”)
$(OAuth_param ‘oauth_timestamp’ “$(OAuth_timestamp)”)
$(OAuth_param ‘oauth_token’ “$oauth_token”)
$(OAuth_param ‘status’ “$status”)
)
base_string=$(OAuth_base_string ‘POST’ ‘https://api.twitter.com/1.1/statuses/update.json’ “${params[@]}”)
signature=$(OAuth_signature “$base_string”)
params[${#params[@]}]=$(OAuth_param ‘oauth_signature’ “$signature”)
ah="Authorization: OAuth "$(_OAuth_authorization_header_params_string “${params[@]}”)
echo $ah
ret=$(/usr/local/bin/curl -s -H “$ah” --data-urlencode “status=$status” “$T_STATUSES_UPDATE”)
echo $ret