Advertisement
shutdown57

Twitter tools

Dec 14th, 2017
893
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.07 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ##  Author :: shutdown57 (alinko) < alinkokomansuby@gmail.com >
  4. ##  https://facebook.com/alinko.jp | JavCode Present.
  5.  
  6. m="\033[1;31m"
  7. k="\033[1;33m"
  8. h="\033[1;32m"
  9. b="\033[1;34m"
  10. p="\033[1;37m"
  11. c="\033[0m"
  12. p="\033[0;35m"
  13. s57_downloader()
  14. {
  15.     which wget > /dev/null 2>&1
  16.     if [[ $? -eq 0 ]]; then
  17.         wget $1 -O $2 > /dev/null 2>&1
  18.     else
  19.         which curl > /dev/null 2>&1
  20.         if [[ $? -eq 0 ]]; then
  21.             curl -s $1 > $2
  22.         fi
  23.     fi
  24. }
  25. s57_getMedia(){
  26. s57_downloader "https://twitter.com/$1/media" "shutdown57.twitter.temp"
  27. echo -e $h"[!] Getting page media $b $1 $c ... "
  28. sleep 1
  29. if [[ -f "shutdown57.twitter.temp" ]]; then
  30.     lo=`cat shutdown57.twitter.temp | grep -Po "https:\/\/pbs.twimg.com\/media\/(.*)\.jpg"`
  31.     echo "Creating directory result ..."
  32.     mkdir $1
  33.     for tw in $lo
  34.     do
  35.         IFS="/" read -r -a img <<< "$tw"
  36.         nama=${img[4]}
  37.         if [[ -f $1/$nama ]]; then
  38.             echo ""
  39.         else
  40.             echo -e "shutdown57 : "$tw" $b Downloading $c ... "
  41.             wget $tw -O $1/$nama > /dev/null 2>&1
  42.             if [[ -f $1/$nama ]]; then
  43.                 echo -e "shutdown57 :$h "$1"/"$nama" $c Saved !"
  44.             fi
  45.         fi
  46.  
  47.     done
  48.     rm shutdown57.twitter.temp
  49. fi
  50. }
  51. s57_search(){
  52. echo -e $h"[!] Getting page media $b $1 $c ..."
  53. s57_downloader "https://twitter.com/search?f=users&vertical=default&q=$1" "search-shutdown57.twitter.temp"
  54. sleep 1
  55. if [[ -f "search-shutdown57.twitter.temp" ]]; then
  56.     np=`cat search-shutdown57.twitter.temp | grep -Po "\@<b>(.*)<\/b>" | sort | uniq`
  57.     for re in $np
  58.     do
  59.         IFS="<b>" read -r -a sss <<< "$re"
  60.         apasi3=${sss[3]}
  61.         echo -e $h"[+]$c $apasi3 "
  62.         sleep 0.5
  63.         echo "$apasi3" >> $1.txt
  64.     done
  65.     if [[ -f $1.txt ]]; then
  66.         echo -e $h"[+]$c file saved : $1.txt "
  67.     fi
  68.     rm search-shutdown57.twitter.temp
  69. fi
  70. }
  71. s57_kntwol()
  72. {
  73.     echo -e -n $b"[?]$c shutdown57::$1 >>"
  74.     read $2
  75. }
  76. s57_banner()
  77. {
  78.     clear
  79.     printf $b" _____          _ _   _            _
  80. |_   _|_      _(_) |_| |_ ___ _ __| |
  81.  | | \ \ /\ / / | __| __/ _ \ '__| |
  82.  | |  \ V  V /| | |_| ||  __/ |  |_|
  83.  |_|   \_/\_/ |_|\__|\__\___|_|  (_) $c
  84.                                    
  85. "$h" +================="$k"======================+ "$c"
  86. "$h" || Twitter Tools -"$k" coded by shutdown57 || "$c"
  87. "$h" ||$p         JavCode (c) 2017           $k || "$c"
  88. "$h" +================="$k"======================+ "$c"
  89.  
  90. "$m" [1]"$c" Get Media Username
  91. "$m" [2]"$c" Search username
  92. "$m" [3]"$c" Get Media Mass Username
  93. "$m" [4]"$c" Search username + Get media username
  94.  
  95. $p +============================================+ $c
  96. "
  97. }
  98. s57_main(){
  99. s57_banner
  100.  
  101. read -p "[?] shutdown57::options >>" np
  102.  
  103. if [[ $np == "1" ]]; then
  104.     s57_kntwol "Username" ap
  105.     s57_getMedia "${ap}"
  106. elif [[ $np == "2" ]]; then
  107.     s57_kntwol "Keywords" ap
  108.     s57_search "${ap}"
  109. elif [[ $np == "3" ]]; then
  110.     s57_kntwol "File" ap
  111.     np=`cat $ap`
  112.     yw=$(echo $np | tr "\n" "\n")
  113.     for lo in $yw
  114.     do
  115.         s57_getMedia "${lo}"
  116.     done
  117. elif [[ $np == "4" ]]; then
  118.     s57_kntwol "Keywords" ap
  119.     s57_search "${ap}"
  120.     np=`cat $ap.txt`
  121.     kntl=$(echo $np | tr "\n" "\n")
  122.     for w in $kntl
  123.     do
  124.         s57_getMedia "${w}"
  125.     done
  126.     rm $ap.txt
  127. else
  128.     s57_main
  129. fi
  130. }
  131.  
  132.  
  133. s57_main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement