The little things give you away... A collection of various small helper stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

50 lines
968 B

  1. #!/bin/bash
  2. scriptpath="$(cd "$(dirname "$0")"; pwd -P)"
  3. insta=
  4. if [[ -e transfer ]]
  5. then
  6. echo "Error: ./transfer exists" >&2
  7. exit 1
  8. fi
  9. # ArchiveBot
  10. for f in "$@"
  11. do
  12. upurl="$("${scriptpath}/transfer.notkiska.pw-upload" "${f}")"
  13. echo "${upurl}" >&3
  14. if [[ "${f}" == facebook-* ]]
  15. then
  16. echo "!ao < ${upurl}"
  17. elif [[ "${f}" == twitter-* ]]
  18. then
  19. echo "!ao < ${upurl} --concurrency 6 --delay 0"
  20. elif [[ "${f}" == instagram-* ]]
  21. then
  22. echo "!a < ${upurl}"
  23. insta=1
  24. else
  25. echo "!ao < ${upurl}"
  26. fi
  27. done 3>transfer
  28. # chromebot
  29. for f in "$@"
  30. do
  31. if [[ "${f}" == facebook-@* || "${f}" == twitter-@* ]]
  32. then
  33. head -1 "${f}"
  34. elif [[ "${f}" == twitter-#* ]]
  35. then
  36. head -4 "${f}"
  37. fi
  38. done | sed 's,^,chromebot: a ,'
  39. # Instagram ignore warning
  40. if [[ "${insta}" ]]
  41. then
  42. echo "Don't forget to add the Instagram ignore! ^https?://www.instagram.com/.*[?&]hl=" >&2
  43. fi
  44. echo "Wrote ./transfer, you can run snscrape-wiki-transfer-merge now if ./wiki exists." >&2