Page 1 of 2
shortening links with bit.ly
Posted: 19 Mar 2020 14:39
by tsolignani
Good afternoon everyone.
Anyone with a flow which can shorten links with bit.ly?
I was already told how to do that with u.nu and that's the way I am shortening right now, but I would like to switch to bit.ly.
Many users of mine keep telling me they face issues while trying to open u.nu links (security alerts, mostly).
Or if you have any hint to develop that.
Thank you.
Re: shortening links with bit.ly
Posted: 19 Mar 2020 15:02
by BoBo
The bit.ly API expects some oAuth !
https://dev.bitly.com/v4_documentation.html
Well, you could set up your own SQL DB based 'Automagic' converter - but that means to reinvent the wheel:
https://yourls.org
Good luck
-----
Ooops, looks like
u.nu offers the same functionality as
is.gd.
So the following is left for "whom it may concern"
vLongURL = "
www.example.com" (well, not that long

)
vShortURL:
https://is.gd/MOgh5q
https://u.nu/api/
https://www.is.gd/apishorteningreference.php
Re: shortening links with bit.ly
Posted: 20 Mar 2020 13:57
by BoBo
@tsolignani,
just 4 the records, I've wrote a note to u.nu to advise them about errors thrown out if requested (using Automagic). Here's their/his response
(my comments in yellow):
- First, you've sent to incorrect email address, this is for abuse complaint not for advise purpose. (Well, they didn't provide any additional mail address)
Second, our SSL configuration ranks A+ on SSL Labs (nice2know, but that was what the errormsg was pointing at)
https://www.ssllabs.com/ssltest/analyze.html?d=u.nu
Third, tell your people to upgrade their browser, because we no longer supports TLS 1.0 and TLS 1.1 like what Mozilla and Google does (so, probably Auomagic is to blame??!)
https://hacks.mozilla.org/2019/05/tls-1 ... al-update/
For people who can't visit u.nu, they must still use the old browser or operate systems like Windows XP and IE 9. We will not support these devices for security reason.
Re: shortening links with bit.ly
Posted: 21 Mar 2020 16:00
by Desmanto
@BoBo : Oauth can be done using http request, anuraag have done it. (I don't know the detail yet)
viewtopic.php?f=5&t=8251#p25731
For user agent, you can use custom header to sent others UA string. At the HTTP request
Set Custom HTTP headers
Code: Select all
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
Re: shortening links with bit.ly
Posted: 21 Mar 2020 19:48
by BoBo
@Desmanto
had a try with setting a User-Agent at HTTPRequest, and it worked flawless for u.nu + is.gd
Thx

Re: shortening links with bit.ly
Posted: 22 Mar 2020 09:26
by tsolignani
I found a way to do it with bit.ly using autoweb plugin.
Please find an example flow enclosed, you have to put your access token where you find triple "X"
Have a nice day and thanks again to everyone.
Re: shortening links with bit.ly
Posted: 23 Mar 2020 12:17
by BoBo
Erm, I've never ever worked with (Tasker) plugins before, so I don't know how to deal with them! I'm getting an error after executing your flow (yes, I've already entered my own newly generated bit.ly access token to the XML code). Do I have to upload whatever external data/plugin to get this running? If yes, where to get this? TBH, I've thought "the plugin" is a specific set of code that already has become part of the XML/flow you've provided (means you've embedded it)??
Looks I'm wrong about that
Edit:
OK, I've downloaded "AutoWeb" (which I guess is the Plugin) from Google Play and the configuration code within my Action:Plugin (Experimental) displays the same content of what I see within your flow/xml.
Well, once executed it throws this error: LongURL: {value} and exception Plugin failed with code: 16325251

Re: shortening links with bit.ly
Posted: 23 Mar 2020 13:03
by tsolignani
You have to install autoweb plugin from the play store, license and configure it.
Re: shortening links with bit.ly
Posted: 23 Mar 2020 13:30
by BoBo
Bingo. For whom it may concern: you've to 'license' the (Tasker) AutoWeb-plugin with buying the full version or go for the "watch-advertisements-and-sell-your-soul"-option. Afterward, enable the Bit.ly URL Shortener API option. Done.
Nevertheless, I can't see the benefit of using bit.ly over other free-of-charge URL shorteners. Anyway

Re: shortening links with bit.ly
Posted: 23 Mar 2020 13:33
by anuraag
No need of autoweb. I have used access_token included in autoweb.
http://automagic4android.com/flow.php?i ... c680bed355