diff --git a/snscrape-extract-usernames b/snscrape-extract similarity index 83% rename from snscrape-extract-usernames rename to snscrape-extract index da3fe0c..96f944d 100755 --- a/snscrape-extract-usernames +++ b/snscrape-extract @@ -1,7 +1,7 @@ #!/bin/bash # Extract from stdin social media usernames suitable for snscrape, grouped by service grep -Po '(https?://www\.\Kfacebook\.com/(?!pages/)\S+(?=/)|https?://www\.\Kinstagram\.com/\S+(?=/)|https?://\Ktwitter\.com/\S+)' | - sed 's,\.com/, ,' | + sed 's,\.com/, ,; s,^twitter hashtag/,twitter-hashtag ,; s,twitter ,twitter-user ,' | sort | awk ' BEGIN { diff --git a/snscrape-prepare-commands b/snscrape-prepare-commands index 640d58a..0b35ad9 100755 --- a/snscrape-prepare-commands +++ b/snscrape-prepare-commands @@ -1,9 +1,18 @@ #!/bin/bash scriptpath="$(cd "$(dirname "$0")"; pwd -P)" -"${scriptpath}/snscrape-extract-usernames" | while read -r service line +"${scriptpath}/snscrape-extract" | while read -r service line do - if [[ "${service}" == "facebook:" || "${service}" == "instagram:" || "${service}" == "twitter:" ]] + if [[ "${service}" == "facebook:" ]] + then + echo "printf '%s\n' ${line} | parallel -n 1 -k -j 4 $(printf "%q" "${scriptpath}")/snscrape-facebook-user" + elif [[ "${service}" == "twitter-hashtag:" ]] + then + echo "printf '%s\n' ${line} | parallel -n 1 -k -j 3 $(printf "%q" "${scriptpath}")/snscrape-twitter-hashtag" + elif [[ "${service}" == "twitter-user:" ]] + then + echo "printf '%s\n' ${line} | parallel -n 1 -k -j 3 $(printf "%q" "${scriptpath}")/snscrape-twitter-user" + elif [[ "${service}" == "instagram:" ]] then echo "for user in ${line}; do $(printf "%q" "${scriptpath}")/snscrape-${service:0:-1}-user "'"${user}"; done' fi