Open links from a Twitter notification?

I'm trying to make a macro that extracts the link from a notification and open it in my browser. I already know how to extract the link using regex and simply use the open website action, but the problem with Twitter is that it's shortens links and adds a ... to the end of it, so I'm not able to open the website when it's only able to extract half of the address.

I'm just wondering if anyone has a work around for this because the only option that I can think off the top of my head is to open the notification bringing me to the Twitter post and then click on it, but I'd be a lot more efficient to just go straight to the website instead of doing all that through actions.

Might just have to go with what I have though.

Edit: Chat GPT is very useful in helping make regex's, but it looks like there's no way to get around shortened urls it seems.
 
Last edited:

Jacob L

Moderator (Lawsonator)
Text manipulation action replace all and add the ... Also anything after t= on Twitter links is tracking and not necessary
 

Endercraft

Moderator (& bug finder :D)
Text manipulation action replace all and add the ... Also anything after t= on Twitter links is tracking and not necessary
I think t= is for time, just like YouTube although I don't use Twitter so I can't be sure.
 
Text manipulation action replace all and add the ... Also anything after t= on Twitter links is tracking and not necessary
I'm actually stupid, I forgot I can store everything on the screen into a dictionary using the "read screen contents" and extracted the link by going to the key "com.twitter.android:id/row" with text manipulation and doing https:\/\/t\.co\/[A-Za-z0-9]+ which I can then open in my browser.

This all requires me to open the tweet unfortunately, but your method would work if the link was able to auto complete itself, it's just that the links I'm trying to get has random numbers at the end and gets cut off by the link shortening, so I guess in my case this just doesn't work, was hoping to do everything without having to open the app manually.
 
Top