Created
March 17, 2017 09:11
-
-
Save solebox/6d7a557d91d64b1cd0c9459cb0965d2e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
token="EAACEdEose0cBAOekRbHcKZBCGgbuyQGMCIc6k2rGY2VLH5l3I4hbXdAUsnrZBZCZAhqpaIKDy9x4hmEyDX8B3v0vxkZBRKmD8yFRTfNUKk2WZCjxISfphlcExK7gIwgjehwfLIonGINWQupBLRmHwgqeRZBbyKYWqnQvIezi4dpMZCIB74vtvGHe" | |
photka="$1" | |
sched_time=$(date -d "$2" +"%s") | |
if [ -z "$1" ]; then | |
echo "usage: <photka path> [<pub-time>]" | |
echo "" | |
echo "<pub-time> values: +1 day, +1 hour, just like with date" | |
echo "" | |
echo "examples:" | |
echo " to post right now:" | |
echo " $0 ./lol.png" | |
echo " to post tommorow:" | |
echo " $0 ./lol.png 1" | |
elif [ -z "$2" ]; then | |
# post now | |
curl -i -X POST -F file1=@$photka -F "access_token=$token" "https://graph.facebook.com/v2.8/Trolling.inc/photos" | |
else | |
# sched post | |
curl -i -X POST -F file1=@$photka -F "access_token=$token" -F "published=false" -F "scheduled_publish_time=$sched_time" "https://graph.facebook.com/v2.8/Trolling.inc/photos" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment