Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- CORREO="Tu_correo"
- PASS="Tu_pass"
- DATOS=$( curl -u "$CORREO":"$PASS" --silent "https://mail.google.com/mail/feed/atom" )
- CANTIDAD=$( echo $DATOS | grep -oPm1 "(?<=<email>)[^<]+" | wc -l )
- items=( )
- for i in `seq 1 $CANTIDAD`
- do
- NOMBRE=$( echo $DATOS | grep -oPm1 "(?<=<name>)[^<]+" | head -$i | tail -1 )
- AUTOR=$( echo $DATOS | grep -oPm1 "(?<=<email>)[^<]+" | head -$i | tail -1 )
- ASUNTO=$( echo $DATOS | grep -oPm1 "(?<=<title>)[^<]+" | sed '1d' | head -$i | tail -1 )
- RESUMEN=$( echo $DATOS | grep -oPm1 "(?<=<summary>)[^<]+" | head -$i | tail -1 )
- ID=$( echo $DATOS | grep -oP "(?<=message_id=)[^&]+" | head -$i | tail -1 )
- FECHA=$( echo $DATOS | grep -oPm1 "(?<=<issued>)[^T]+" | awk -F '-' '{print $3"-"$2"-"$1}' | head -$i | tail -1 )
- HORA=$( echo $DATOS | grep -oPm1 "(?<=<issued>)[^Z]+" | awk -F 'T' '{print $2}' | head -$i | tail -1 )
- items+=( "$NOMBRE" "$AUTOR" "$ASUNTO" "$RESUMEN" "$ID" "$FECHA" "$HORA" )
- done
- yad --text="\n\tUsted tiene <b>$CANTIDAD</b> correos nuevos.\n" \
- --no-buttons --list \
- --width="1200" --height="520" --title="Correos nuevos: "$CANTIDAD"" \
- --column="Nombre" --column="Autor" \
- --column="Asunto" --column="Resumen" \
- --column="ID" --column="Fecha" \
- --column="Hora" "${items[@]}"
- # Final del camino...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement