Jump to content


Photo

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

Shorten URL Link Short Shortener Workflow Python bit.ly goo.gl

  • Please log in to reply
55 replies to this topic

#1 hzlzh

hzlzh

    Member

  • Member
  • PipPip
  • 177 posts

Posted 15 March 2013 - 04:10 PM

Shorten-URL-icon.png

Shorten URL (v1.1) - download here

 

Github Page:

https://github.com/h...lfred-Workflows

 

This workflow support URL shortener like below. You can use Hotkey to trigger without open Alfred input window.

  • goo.gl/
  • bit.ly/
  • t.cn/
  • j.mp/
  • is.gd/
  • v.gd/

If you want more URL shortener services added, please let me know, :) .

 

How-To:

Choose some long links (e.g Command + A), then press `Command + Shift +L`, choose goo.gl and you will get the short link in your clipboard with notification center triggered.

 

Tips:

How to use this workflow without copy/paste?

Just use trigger HotKey, check out this wiki issue here:

https://github.com/h...kflows/issues/1

 

Screenshot:

 

Shorten-URL-trigger.png

 

Shorten-URL-notification.png

 

Shorten-URL-workflow.png


Edited by hzlzh, 05 April 2013 - 01:22 PM.

  • thec13, Luzzifus, hzlzh and 4 others like this

Share on [Alfred Workflow List](Un-offical) : www.AlfredWorkflow.comSubmit Workflows | Workflow Searcher


#2 Luzzifus

Luzzifus

    Newbie

  • Member
  • Pip
  • 7 posts
  • LocationGermany

Posted 15 March 2013 - 06:30 PM

Very nice and helpful, thanks!  :)



#3 hzlzh

hzlzh

    Member

  • Member
  • PipPip
  • 177 posts

Posted 16 March 2013 - 03:13 AM

Very nice and helpful, thanks!  :)

if you need more shortener services, please let me know.


  • Subject22 likes this

Share on [Alfred Workflow List](Un-offical) : www.AlfredWorkflow.comSubmit Workflows | Workflow Searcher


#4 michelb

michelb

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 16 March 2013 - 11:04 AM

Thank you.

 

I just changed the API Key and the Login so I see my shortened URLs at bit.y


  • Cedric and ApeWare like this

#5 bluecorr

bluecorr

    Newbie

  • Member
  • Pip
  • 6 posts

Posted 16 March 2013 - 01:49 PM

Hi, I'm new to Mac and have discovered Alfred and I'm in love with it. I'm not a developer but I can work out what scripts do but I've hit a brick wall! (after several hours of trying different things!)

 

I'm trying to expand a short url and show it in Alfred's result list. I was able to use shell script and curl to expand it and have it copied to the clipboard but I want it displayed as an action so that I can see it and then copy it but I can't for the life of me work out how to combine the script that expands the URL with the xml script filter! I am guessing I need to pass the result of script 1 to script 2 but not sure how to do that.

 

Can anyone help?

 

Many thanks



#6 MrMuetze

MrMuetze

    Newbie

  • Member
  • Pip
  • 12 posts

Posted 16 March 2013 - 06:01 PM

Nice workflow. Love it!



#7 marse

marse

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 17 March 2013 - 04:06 PM

It's awesome :)

Thanks



#8 hzlzh

hzlzh

    Member

  • Member
  • PipPip
  • 177 posts

Posted 18 March 2013 - 01:54 AM

Thank you.

 

I just changed the API Key and the Login so I see my shortened URLs at bit.y

 

nice step.


Share on [Alfred Workflow List](Un-offical) : www.AlfredWorkflow.comSubmit Workflows | Workflow Searcher


#9 hzlzh

hzlzh

    Member

  • Member
  • PipPip
  • 177 posts

Posted 18 March 2013 - 02:02 AM

Hi, I'm new to Mac and have discovered Alfred and I'm in love with it. I'm not a developer but I can work out what scripts do but I've hit a brick wall! (after several hours of trying different things!)

 

I'm trying to expand a short url and show it in Alfred's result list. I was able to use shell script and curl to expand it and have it copied to the clipboard but I want it displayed as an action so that I can see it and then copy it but I can't for the life of me work out how to combine the script that expands the URL with the xml script filter! I am guessing I need to pass the result of script 1 to script 2 but not sure how to do that.

 

Can anyone help?

 

Many thanks

 

If you need this `short -> long` feature to be added, mybe I can focus on after work time.
 


Share on [Alfred Workflow List](Un-offical) : www.AlfredWorkflow.comSubmit Workflows | Workflow Searcher


#10 simonlindgren

simonlindgren

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 27 March 2013 - 10:56 AM

Great workflow, thanks!
 

But it freezes at "Loading services list" when url includes Scandinavian characters å, ä or ö.

 

Example: https://maps.google....ved=0CC0Q8gEwAA

 

Fixable?



#11 milodaman

milodaman

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 27 March 2013 - 07:31 PM

Can you please add smugmug's shortener. http://www.smugmug.com/shorten

 

thanks!



#12 altryne

altryne

    Member

  • Member
  • PipPip
  • 41 posts

Posted 05 April 2013 - 12:54 PM

Thanx for this! Can you add that if I have a url in the clipboard that the workflow will suggest to shorten it directly? So I won't have to paste it in?



#13 hzlzh

hzlzh

    Member

  • Member
  • PipPip
  • 177 posts

Posted 05 April 2013 - 01:19 PM

Thanx for this! Can you add that if I have a url in the clipboard that the workflow will suggest to shorten it directly? So I won't have to paste it in?

There is no need to copy/paste URL, just use trigger HotKey, check out this wiki issue here:

https://github.com/h...kflows/issues/1


Edited by hzlzh, 05 April 2013 - 01:20 PM.

Share on [Alfred Workflow List](Un-offical) : www.AlfredWorkflow.comSubmit Workflows | Workflow Searcher


#14 altryne

altryne

    Member

  • Member
  • PipPip
  • 41 posts

Posted 05 April 2013 - 06:09 PM

There is no need to copy/paste URL, just use trigger HotKey, check out this wiki issue here:

https://github.com/h...kflows/issues/1

 

There are times when another hotkey is confusing, especially when there are tons of workflows installed, and each is with their own hotkey,

At those times, I'm sure I would go up to the address bar, copy the url, open alfred, and hit "shorten" and then realize I could have used the hotkey to do that.

For those times, if you add a url detection inside clipboard, it will save the hustle of pasting it :)

 

It's very easy with ruby, and I imagine it's equaly easy with python

url = URI.extract(`osascript -e "get the clipboard"`)
 



#15 hzlzh

hzlzh

    Member

  • Member
  • PipPip
  • 177 posts

Posted 06 April 2013 - 03:06 PM

There are times when another hotkey is confusing, especially when there are tons of workflows installed, and each is with their own hotkey,

At those times, I'm sure I would go up to the address bar, copy the url, open alfred, and hit "shorten" and then realize I could have used the hotkey to do that.

For those times, if you add a url detection inside clipboard, it will save the hustle of pasting it :)

 

It's very easy with ruby, and I imagine it's equaly easy with python

url = URI.extract(`osascript -e "get the clipboard"`)
 

Good idea, I'll try as you said.


Share on [Alfred Workflow List](Un-offical) : www.AlfredWorkflow.comSubmit Workflows | Workflow Searcher


#16 graphorce

graphorce

    Newbie

  • Member
  • Pip
  • 15 posts

Posted 06 April 2013 - 06:56 PM

Anyway to use this with custom domains on bit.ly?



#17 graphorce

graphorce

    Newbie

  • Member
  • Pip
  • 15 posts

Posted 06 April 2013 - 07:04 PM

\nyway to use this with custom domains on bit.ly?

 

Never mind, got it to work. Thanks a lot for the workflow! :)

 

For those who are wondering how to do it, edit the shorten script in the workflow, find & replace:

'bit.ly' : {'api_url':'https://api-ssl.bitl...mat=json&login=yourusername&apiKey=yourlegacyapikey&longUrl=','title':'bit.ly','des':'http://targetdomain.com'},

 

Target domain must be added to your 'custom short domain name' in bit.ly settings.



#18 pandass4sin

pandass4sin

    Newbie

  • New Member
  • Pip
  • 3 posts

Posted 10 April 2013 - 06:05 PM

Can you add adf.ly? That would be extremely helpful.



#19 Subject22

Subject22

    Member

  • Member
  • PipPip
  • 143 posts

Posted 10 April 2013 - 09:45 PM

Adding shortening with Droplr would be cool! :-)

#20 leefur

leefur

    Member

  • Member
  • PipPip
  • 63 posts

Posted 10 April 2013 - 09:58 PM

Love it! But, a request… is there any way to make it so that hitting the hotkey with a URL selected will pass the URL straight through to one service? (of my choosing in some sort of set up?)

 

I just want to use goo.gl and be done with it, I don't need a selection step. And I imagine most people probably have one service they prefer and use generally.

 

Thanks!





Also tagged with one or more of these keywords: Shorten, URL, Link, Short, Shortener, Workflow, Python, bit.ly, goo.gl

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users