Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # ccocot@bc0de.net
- # in Development
- ###############
- # GLOBAL VARIABLE
- # EDIT ACCESS TOKEN WITH YOUR TOKEN
- # EDIT ACCOUNT ID WITH YOUR ACCOUNT ID
- ###############
- HOST="gabut.club"
- ACCESS_TOKEN="ur token ulala"
- ACCOUNT_ID="57330"
- ################
- # GET TIMELINE FUNCTION
- # RETURN ITEM ID, ACCOUNT ID, myLike, AND USERNAME
- ################
- getFeed(){
- local path="api/v2/method/feeds.get"
- local data="accessToken=${ACCESS_TOKEN}&language=en&itemId=0&accountId=${ACCOUNT_ID}&"
- local url="${HOST}/${path}"
- local result=$(curl -s --url ${url} --data ${data})
- local myLike=$(echo -e "${result}" | grep -Po "(?<=\"myLike\":).*?(?=,)")
- local ids=$(echo -e "${result}" | grep -Po "(?<=\"id\":\").*?(?=\",)")
- local username=$(echo -e "${result}" | grep -Po "(?<=\"fromUserUsername\":\").*?(?=\",)")
- local profileIds=$(echo -e "${result}" | grep -Po "(?<=\"fromUserId\":\").*?(?=\",)")
- local returnValue=$(paste <(echo "${profileIds}") <(echo "${ids}") <(echo "${username}") <(echo "${myLike}") --delimiters='|')
- echo "${returnValue}"
- }
- getRandom(){
- local path="/api/v2/method/random.get"
- local data="accessToken=${ACCESS_TOKEN}&language=en&rating=0&category=0&accountId=${ACCOUNT_ID}&"
- local url="${HOST}/${path}"
- local result=$(curl -s --url ${url} --data ${data})
- local myLike=$(echo -e "${result}" | grep -Po "(?<=\"myLike\":).*?(?=,)")
- local ids=$(echo -e "${result}" | grep -Po "(?<=\"id\":\").*?(?=\",)")
- local username=$(echo -e "${result}" | grep -Po "(?<=\"fromUserUsername\":\").*?(?=\",)")
- local profileIds=$(echo -e "${result}" | grep -Po "(?<=\"fromUserId\":\").*?(?=\",)")
- local returnValue=$(paste <(echo "${profileIds}") <(echo "${ids}") <(echo "${username}") <(echo "${myLike}") --delimiters='|')
- echo "${returnValue}"
- }
- getStream(){
- local path="/api/v2/method/stream.get"
- local data="accessToken=${ACCESS_TOKEN}&language=en&itemId=0&accountId=${ACCOUNT_ID}&"
- local url="${HOST}/${path}"
- local result=$(curl -s --url ${url} --data ${data})
- local myLike=$(echo -e "${result}" | grep -Po "(?<=\"myLike\":).*?(?=,)")
- local ids=$(echo -e "${result}" | grep -Po "(?<=\"id\":\").*?(?=\",)")
- local username=$(echo -e "${result}" | grep -Po "(?<=\"fromUserUsername\":\").*?(?=\",)")
- local profileIds=$(echo -e "${result}" | grep -Po "(?<=\"fromUserId\":\").*?(?=\",)")
- local returnValue=$(paste <(echo "${profileIds}") <(echo "${ids}") <(echo "${username}") <(echo "${myLike}") --delimiters='|')
- echo "${returnValue}"
- }
- ################
- # ACTION FUNCTION LIKE,
- # COMMENT, MESSAGE, UPDATE STATUS
- # RETURN TRUE OF FALSE
- ################
- doLike(){
- local itemId=$1
- local myLike=$3
- local path="/api/v2/method/items.like"
- local data="accessToken=${ACCESS_TOKEN}&accountId=${ACCOUNT_ID}&itemId=${itemId}&"
- local url="${HOST}/${path}"
- if [[ $myLike = "false" ]]; then
- local result=$(curl -s --url ${url} --data ${data} | grep -Po "(?<=\"myLike\":).*?(?=})")
- echo "USERNAME: $2, ITEM_ID: $itemId, LIKED: ${result}"
- fi
- }
- updateStatus(){
- local text=$1
- local path="/api/v2/method/items.new"
- local data="videoUrl=&accessToken=${ACCESS_TOKEN}&postMode=0&videoImgUrl=&postImg=&groupId=0&postText=${text}&accountId=${ACCOUNT_ID}&postCity=&postLng=0.000000&postCountry=&postArea=&postLat=0.000000&"
- local url="${HOST}/${path}"
- local result=$(curl -s --url ${url} --data ${data})
- echo "${result}"
- }
- messagePerson(){
- local targetId=$2
- local profile=$(curl -s --url "${HOST}/api/v2/method/profile.get" --data "accessToken=${ACCESS_TOKEN}&accountId=${ACCOUNT_ID}&profileId=${targetId}&" | grep -Po "(?<=\"sex\":\").*?(?=\")")
- if [[ ${profile} -eq "2" ]]; then
- local text=$1
- local path="/api/v2/method/msg.new"
- local data="profileId=${targetId}&listId=2&chatFromUserId=0&accountId=${ACCOUNT_ID}&chatToUserId=0&accessToken=${ACCESS_TOKEN}&messageImg=&chatId=0&stickerImgUrl=&stickerId=0&messageText=${text}&"
- local url="${HOST}/${path}"
- local result=$(curl -s --url ${url} --data "${data}")
- echo "USERNAME: $3, ITEM_ID: $targetId, (${text})"
- fi
- }
- ################
- # SERVICES
- # AUTOLIKE, AUTO MESSAGE
- # call with & for add pid proccess
- # exp : autolike true &
- # don't forget to use wait
- ################
- autoLike(){
- while [[ $1 ]]; do
- local one=$(getStream)
- local two=$(getRandom)
- for user in $(echo "${one}/${two}"); do
- IFS='|' read -ra ARR <<< "$user"
- doLike ${ARR[1]} ${ARR[2]} ${ARR[3]} &
- done
- sleep 10
- done
- }
- sayHay(){
- local PAGI="09"
- local SIANG="12"
- local SORE="15"
- local MALEM="21"
- local one=$(getStream)
- local two=$(getRandom)
- for user in $(echo "${one}/${two}"); do
- IFS='|' read -ra ARR <<< "$user"
- local timenow=$(date | awk '{ print $4 }' | cut -d ":" -f1)
- if [[ ${timenow#0} -ge "00" && ${timenow#0} -lt "12" ]]; then
- messagePerson "Selamat Pagi" ${ARR[0]} ${ARR[2]}
- elif [[ ${timenow#0} -ge "12" && ${timenow#0} -lt "15" ]]; then
- messagePerson "Selamat Siang" ${ARR[0]} ${ARR[2]}
- elif [[ ${timenow#0} -ge "15" && ${timenow#0} -lt "19" ]]; then
- messagePerson "Selamat Sore" ${ARR[0]} ${ARR[2]}
- elif [[ ${timenow#0} -ge "19" && ${timenow#0} -lt "23" ]]; then
- messagePerson "Selamat Malem" ${ARR[0]} ${ARR[2]}
- fi
- sleep 10
- done
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement