Ir al contenido principal

Mute google reader feeds

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

Entradas populares de este blog

Use rclone to mount cloud storage

I realized that the fat clients that allows you to sync your contents are not only wasting CPU cycles but also lots of disk space. Yes, that enables you to have the file opened almost instantly, no matter its size, but for me that use case is almost never needed, I use the cloud storage to save stuff that is in the range of a few MiB. Here is where rclone comes into play, it allows you to mount your storage as if it were a regular disk, and it handles the communication with the cloud servers on the go. As there are many different combinations I'll cover only two Linux w/ Dropbox curl https://rclone.org/install.sh | bash # Use rclone config to add a new remote called db for dropbox MAIN_USER=$SUDO_USER MAIN_USER_HOME=$(grep ^$SUDO_USER: /etc/passwd | head -1 | cut -d: -f6) mkdir /media/db chown $MAIN_USER:$MAIN_USER /media/db cat <<EOF > /lib/systemd/system/rclone-db.service [Unit] Description=Dropbox rclone mount After=multi-user.targetrclone [Service] Type=simple User=$ M...