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.
 
 
 

26 lines
530 B

  1. #!/bin/bash
  2. # Extract from stdin social media usernames suitable for snscrape, grouped by service
  3. grep -Po '(https?://www\.\Kfacebook\.com/(?!pages/)\S+(?=/)|https?://www\.\Kinstagram\.com/\S+(?=/)|https?://\Ktwitter\.com/\S+)' |
  4. sed 's,\.com/, ,; s,^twitter hashtag/,twitter-hashtag ,; s,twitter ,twitter-user ,' |
  5. sort |
  6. awk '
  7. BEGIN {
  8. prev1="";
  9. }
  10. ($1 != prev1) {
  11. if (prev1 != "") {
  12. print "";
  13. }
  14. printf "%s:", $1;
  15. prev1 = $1;
  16. }
  17. ($1 == prev1) {
  18. printf " %s", $2;
  19. }
  20. END {
  21. print "";
  22. }'