andmalv

[Script] SaberUltimaHoraConexionAmigosFacebook

Aug 28th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.84 KB | None | 0 0
  1. #! /bin/bash
  2. #
  3. # Ver código fuente de nuestro perfil de Facebook, buscar (Ctrl + F) lastActiveTimes y copiar los valores.
  4. # Notación
  5. #   lastActiveTimes:{"IdUser":UltHrConex}
  6.  
  7. clear
  8.  
  9. read -p $'\n\t Ingrese los Datos: ' amigos
  10. amigos=($(echo $amigos | tr ',' ' '))
  11.  
  12. clear
  13.  
  14. for x in ${amigos[@]}; do
  15.     ID=$(echo $x | cut -d ':' -f 1 | tr -d '"')
  16.     PosixTime=$(echo $x | cut -d ':' -f 2)
  17.     URL="https://www.facebook.com/profile.php?id=${ID}"
  18.     html=$(curl -sL "$URL")
  19.     UltV=$(date -d @${PosixTime} +"El %d/%m/%Y a las %H:%M:%S")
  20.     name=$(echo "$html" | egrep -io '<title id="pageTitle">[A-Z]+ [A-Z]+' | cut -d '>' -f 2)
  21.     [ -z "$name" ] && name="Unknown"
  22.    
  23.     echo -en "
  24.        URL = $URL
  25.        Nombre: $name
  26.        Ultima vez: $UltV
  27.        
  28.        Presione una tecla para continuar... "
  29.     read
  30. done
  31.  
  32. clear
Add Comment
Please, Sign In to add comment