hzlzh Posted March 15, 2013 Posted March 15, 2013 (edited) Shorten URL (v1.1) - download here Github Page: https://github.com/hzlzh/Alfred-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: Edited April 5, 2013 by hzlzh Teodin, bcometa, jpmartin and 7 others 10
hzlzh Posted March 16, 2013 Author Posted March 16, 2013 Very nice and helpful, thanks! if you need more shortener services, please let me know. Subject22 1
michelb Posted March 16, 2013 Posted March 16, 2013 Thank you. I just changed the API Key and the Login so I see my shortened URLs at bit.y Cedric and ApeWare 2
bluecorr Posted March 16, 2013 Posted March 16, 2013 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
hzlzh Posted March 18, 2013 Author Posted March 18, 2013 Thank you. I just changed the API Key and the Login so I see my shortened URLs at bit.y nice step.
hzlzh Posted March 18, 2013 Author Posted March 18, 2013 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.
simonlindgren Posted March 27, 2013 Posted March 27, 2013 Great workflow, thanks! But it freezes at "Loading services list" when url includes Scandinavian characters å, ä or ö. Example: https://maps.google.com/maps?client=safari&oe=UTF-8&q=google+maps+umeå&ie=UTF-8&hq=&hnear=0x467c4e1b68add7f9:0x4034506de8c8560,Umeå,+Sverige&ei=GNBSUabLF87Psga5sYHgDw&ved=0CC0Q8gEwAA Fixable?
milodaman Posted March 27, 2013 Posted March 27, 2013 Can you please add smugmug's shortener. http://www.smugmug.com/shorten thanks!
altryne Posted April 5, 2013 Posted April 5, 2013 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?
hzlzh Posted April 5, 2013 Author Posted April 5, 2013 (edited) 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/hzlzh/Alfred-Workflows/issues/1 Edited April 5, 2013 by hzlzh
altryne Posted April 5, 2013 Posted April 5, 2013 There is no need to copy/paste URL, just use trigger HotKey, check out this wiki issue here: https://github.com/hzlzh/Alfred-Workflows/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"`)
hzlzh Posted April 6, 2013 Author Posted April 6, 2013 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.
graphorce Posted April 6, 2013 Posted April 6, 2013 Anyway to use this with custom domains on bit.ly?
graphorce Posted April 6, 2013 Posted April 6, 2013 \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.bitly.com/v3/shorten?format=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. shadowfax1 1
pandass4sin Posted April 10, 2013 Posted April 10, 2013 Can you add adf.ly? That would be extremely helpful.
Subject22 Posted April 10, 2013 Posted April 10, 2013 Adding shortening with Droplr would be cool! :-)
leefur Posted April 10, 2013 Posted April 10, 2013 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!
hzlzh Posted April 11, 2013 Author Posted April 11, 2013 (edited) Can you add adf.ly? That would be extremely helpful. adf.ly does not support API, so I can't add this service. Edited April 11, 2013 by hzlzh
hzlzh Posted April 11, 2013 Author Posted April 11, 2013 Adding shortening with Droplr would be cool! :-) I just checked Droplr's API Introduction here: http://help.droplr.com/customer/portal/articles/1014091-introduction and I've sent an Email to apply an API, just wait for the reply.
hzlzh Posted April 11, 2013 Author Posted April 11, 2013 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! That's right, I'll find some way to short an URL directly for some users, for now, you can edit some of the workflow's code to pass that step of choosing services maybe. leefur 1
revmetals Posted April 15, 2013 Posted April 15, 2013 Is it possible to set this up to use my account for any/each of these services?
hzlzh Posted April 15, 2013 Author Posted April 15, 2013 Is it possible to set this up to use my account for any/each of these services? Yes you can, just replace the API KEY below with your own.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now