Add a cron job for this script:
#!/usr/bin/env bash
################################################################################
# Author: Borja Garcia
# Program: GReaderMuted
# Descrip: Mute all entrys below a label
# Version: 0.0.0
# Date: 20120228
# License: This script doesn't require any license since it's not intended to be
# redistributed. In such case, unless stated otherwise, the purpose of
# the author is to follow GPLv3.
# Version: 0.0.0 (20120228)
# - Initial release
################################################################################
# Parameters
DATE=`date +%Y%m%d`
SCRIPT_PATH="${BASH_SOURCE[0]}"
while [ -h "$SCRIPT_PATH" ] ; do
SCRIPT_PATH="$(readlink "$SCRIPT_PATH")";
done
SCRIPT_DIR="$( cd -P "$( dirname "$SCRIPT_PATH" )" && pwd )"
LOG_PATH="$SCRIPT_DIR/log"
# Main function
function main() {
label="Muted"
# Do what you wanna do
curl -s https://www.google.com/accounts/ClientLogin -d Email=insert_here@gmail.com -d Passwd=insert_here -d source=greadermuted -d service=reader -d accountType=HOSTED_OR_GOOGLE -o auth
sleep 10
auth=`cat auth | grep ^Auth | cut -d= -f2` && rm auth
echo "The auth is $auth"
curl -s -o token --header "Authorization: GoogleLogin auth=$auth" https://www.google.com/reader/api/0/token?ck=`date +%N`&client=greadermuted
sleep 10
token=`cat token` && rm token
echo "The token is $token"
curl -s -o userinfo --header "Authorization: GoogleLogin auth=$auth" https://www.google.com/reader/api/0/user-info?ck=`date +%N`&client=greadermuted
sleep 10
echo "User info:"
cat userinfo && rm userinfo
echo ""
curl -s -o result --header "Authorization: GoogleLogin auth=$auth" https://www.google.com/reader/api/0/mark-all-as-read?client=greadermuted -d s=user/-/label/$label -d T=$token
sleep 10
result=`cat result`
echo "The result of marking label \"$label\" as read is $result" && rm result
}
# Entry point
main
Comentarios
Publicar un comentario