Browse Source

More flexible normalisation

master
JustAnotherArchivist 5 years ago
parent
commit
6fb9587a2b
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      snscrape-normalise

+ 5
- 3
snscrape-normalise View File

@@ -13,7 +13,7 @@ do
errorUrls+=("${url}")
echo "${url}"
fi
elif [[ "${url}" =~ ^https?://twitter\.com/[^/]+$ ]]
elif [[ "${url}" =~ ^https?://(www\.)?twitter\.com/[^/]+$ ]]
then
user="$(snscrape --max-results 1 twitter-user "${url##*/}" | grep -Po '^https?://twitter\.com/\K[^/]+')"
if [[ "${user}" ]]
@@ -23,9 +23,11 @@ do
errorUrls+=("${url}")
echo "${url}"
fi
elif [[ "${url}" =~ ^https?://www\.instagram\.com/[^/]+/$ ]]
elif [[ "${url}" =~ ^https?://(www\.)?instagram\.com/[^/]+/?$ ]]
then
echo "${url,,}"
user="${url%/}"
user="${user##*/}"
echo "https://www.instagram.com/${user,,}/"
else
echo "${url}"
fi


Loading…
Cancel
Save