roza Posted March 14, 2013 Share Posted March 14, 2013 I was trying to turn Mike Walker's url shortener extension into an Alfred 2 Workflow but failed. Anyone else know how to do this? Here is the link to the extension: http://incredimike.com/projects/alfred-gurl/ Link to comment
ctwise Posted March 14, 2013 Share Posted March 14, 2013 I was trying to turn Mike Walker's url shortener extension into an Alfred 2 Workflow but failed. Anyone else know how to do this? Here is the link to the extension: http://incredimike.com/projects/alfred-gurl/ You would do it like this: And the script would look like this: # longURL supplied by user $longUrl = "{query}"; # Use commandline curl because it's good at these sort of things $resp = `curl --silent https://www.googleapis.com/urlshortener/v1/url -H 'Content-Type: application/json' -d '{"longUrl": "$longUrl"}'`; # Use JSON extension added in PHP 5.2 $json = json_decode( $resp ); # Echo out the URL. echo $json->id; Link to comment
roza Posted March 14, 2013 Author Share Posted March 14, 2013 Hi, thanks! I recreated this but unfortunately, I don't get the shortened url, just the url I started out with. Would you be so kind as to provide your workflow so I can see what I did wrong? Link to comment
ctwise Posted March 14, 2013 Share Posted March 14, 2013 I was reluctant to post it since it isn't my workflow, I just moved it into v2 format. Here you go: http://tedwi.se/u/do Link to comment
macbookandrew Posted March 15, 2013 Share Posted March 15, 2013 For anyone else looking for this who doesn't want to rebuild it, you can download it here: http://goo.gl/wk9BG Thanks to Mike for his initial work on it! Ginfuru 1 Link to comment
isemann Posted March 18, 2013 Share Posted March 18, 2013 Thanks macbookandrew and of course Mike for the initial shortener (even though there was already one ) Thanks of course Andrew and Vero too. There are many reasons to love Alfred and this is just one example - the first url shortener I used stopped working, quick Google and got Mikes version (much quicker than diagnosing/testing etc.). Then v2 Alfred comes round, url shortener and snippets gone! I upgraded early. Very short time later import doodads sorted out. Done that, then quick hunt and shortener found (here). No wonder Alfred receives so much love. Deservedly so. R! Link to comment
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