shortening links with bit.ly

Post your questions and help other users.

Moderator: Martin

User avatar
tsolignani
Posts: 187
Joined: 12 Jan 2019 11:53
Location: Vignola, Mo, Italy
Contact:

shortening links with bit.ly

Post by tsolignani » 19 Mar 2020 14:39

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.

BoBo
Posts: 129
Joined: 05 May 2014 12:45

Re: shortening links with bit.ly

Post by BoBo » 19 Mar 2020 15:02

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" 8-)

vLongURL = "www.example.com" (well, not that long :lol:)
vShortURL: https://is.gd/MOgh5q


https://u.nu/api/
https://www.is.gd/apishorteningreference.php

BoBo
Posts: 129
Joined: 05 May 2014 12:45

Re: shortening links with bit.ly

Post by BoBo » 20 Mar 2020 13:57

@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.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: shortening links with bit.ly

Post by Desmanto » 21 Mar 2020 16:00

@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
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

BoBo
Posts: 129
Joined: 05 May 2014 12:45

Re: shortening links with bit.ly

Post by BoBo » 21 Mar 2020 19:48

@Desmanto
had a try with setting a User-Agent at HTTPRequest, and it worked flawless for u.nu + is.gd
Thx :)

User avatar
tsolignani
Posts: 187
Joined: 12 Jan 2019 11:53
Location: Vignola, Mo, Italy
Contact:

Re: shortening links with bit.ly

Post by tsolignani » 22 Mar 2020 09:26

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.
Attachments
flow_ProvaBitly_copy_20200322_102423.xml
(7.98 KiB) Downloaded 844 times

BoBo
Posts: 129
Joined: 05 May 2014 12:45

Re: shortening links with bit.ly

Post by BoBo » 23 Mar 2020 12:17

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 :oops:

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 :?:
Last edited by BoBo on 23 Mar 2020 13:03, edited 1 time in total.

User avatar
tsolignani
Posts: 187
Joined: 12 Jan 2019 11:53
Location: Vignola, Mo, Italy
Contact:

Re: shortening links with bit.ly

Post by tsolignani » 23 Mar 2020 13:03

You have to install autoweb plugin from the play store, license and configure it.

BoBo
Posts: 129
Joined: 05 May 2014 12:45

Re: shortening links with bit.ly

Post by BoBo » 23 Mar 2020 13:30

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 8-)

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: shortening links with bit.ly

Post by anuraag » 23 Mar 2020 13:33

No need of autoweb. I have used access_token included in autoweb.
http://automagic4android.com/flow.php?i ... c680bed355

Post Reply