Jump to content

[Workflow]Shorten URL (support goo.gl/ bit.ly/ t.cn/ j.mp/ is.gd/ v.gd/)


Recommended Posts

On 8/24/2016 at 6:54 PM, jenz said:

Perhaps someone has already pointed this out, but in case not...

The way I got the Google shorter to start working again, was to generate my own API key (you'll need to do that in your Google Developer account — set one up if you need to) and add it to the scripting in this Workflow, as follows:

 

Change this:


0 : {'api_url':'https://www.googleapis.com/urlshortener/v1/url','title':'goo.gl','des':'http://goo.gl/'},

to this:


0 : {'api_url':'https://www.googleapis.com/urlshortener/v1/url?key=YOUR-API-KEY','title':'goo.gl','des':'http://goo.gl/'},

It now works just fine.  ;)

 

I also added my own API key to the bit.y and j.mp shorteners. Apparently the API used (by the kind developer of this workflow) was reaching its limit. Now those two services also work again.

Thanks by way! This worked perfectly for me as well!

Link to comment
  • 4 weeks later...

It should also be noted that bitly.com is moving towards Oauth - so you can use this url for api_url instead:

 

https://api-ssl.bitly.com/v3/shorten?format=json&access_token=ACCESS_TOKEN&longUrl=

 

or this one for j.mp:

 

https://api-ssl.bitly.com/v3/shorten?format=json&access_token=ACCESS_TOKEN&domain=j.mp&longUrl=

 

Where "ACCESS_TOKEN" is an access token generated here: https://bitly.com/a/oauth_apps

Link to comment
  • 3 weeks later...
  • 2 weeks later...
On 12/29/2016 at 4:21 PM, Giuseppe A said:

I have installed the "shorten" workflow which fails to shorten links by using "goo.nl" (screenshot attached).

It says the link is being copied to clipboard but it's blank.

 

Do you know what the problem might be?

Screen Shot 2016-12-29 at 22.19.38.png

 

I agree with you man, cant seem to get google work.

Link to comment
  • 1 month later...
  • 6 months later...
  • 6 months later...

It appears the author has forgotten to include his API key for the Google url shortener. I've created a patch for the author. Hopefully he'll accept my patch and release it on the official channel.

 

For those who want the patch now, here's the link.

 

Please note: This release contains the MIT License that is passed on from the Author and covers all legal matter regarding warranty and any loss or damage. By using this release, you agree to these terms.

Edited by iNinja
Link to comment
  • 3 months later...
  • 4 months later...
  • 10 months later...
  • 9 months later...
  • 1 year later...
  • 4 weeks later...
20 hours ago, xilopaint said:

 

Workflows are not paid products. 

Fair enough, but this application's power pack is a paid product, only for MAC OS no less. Following deprecation of PHP and Python2, we have to do what exactly to get said workflows to work? Patch patches? 

Link to comment
8 minutes ago, KopperHead said:

Fair enough, but this application's power pack is a paid product, only for MAC OS no less. Following deprecation of PHP and Python2, we have to do what exactly to get said workflows to work? Patch patches? 

 

If you don't want to reinstall Python 2 and follow the guidelines recommended by @vitoryou should ask the creator for a port to Python 3 or do it yourself.

Link to comment
  • 5 months later...
  • 3 months later...
On 9/13/2022 at 7:20 PM, vitor said:

Welcome @nilblank,

 

As per my comment above, follow the official guide and this will work again.

 

But for anyone looking to shorten URLs, you can do it easily and without code with Automation Tasks—in the URL Processing group there is one to shorten URLs.

 

Hey, just wanted to say that as you suggested and as a total noob I was able to create a URL Shortener using Automation Tasks. It took me a little bit of digging to get it to work but let's say I'm proud of myself haha.

 

Thanks for the suggestion :)

 

(If someone want's to create their own, just make sure you choose "Argument required" in the Keyword window)

 

1. In Alfred Preferences, go to the Workflows section

2. choose Create a new workflow

3. If not automatically opened, click on the top right hand colourful burger

4. Drop the Keyword object that they give in the text below and enter the text you want to use as a prompt. Choose "Argument required" to the right

5. In the Automation section, drag the Automation Task object to the board and double click it to open it.

6. Under URL processing, choose Shorten URL

7. In the Output section, choose Copy to clipboard.

8. Link the 3 objets Keyword -> Automation Task -> Copy to Clipboard

9. Success ;)

 

To use it:

- copy a URL you want to shorten

- Invoque Alfre

- type in your prompt then space and paste your URL

- The shortened URL will be saved in your clipboard to be pasted.

 

Cheers,

 

Rad 

1939142071_Screenshot2022-12-15at15_32_27.png.309dd503952b1274b2a4ff462632aa53.png

 

1587690235_Screenshot2022-12-15at15_32_44.png.85238b74e6a7d47717dcee9e860d1489.png

Edited by Rad
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...