# convert any http Twitter url into https, for the sake of user security
# only convert the protocol part, not all occurences of http://, in case users want to search that
endpoint = endpoint.replace('http://','https://',1)
This is to ensure all passed Twitter urls are converted into https, without messing with the rest of the url.