Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.6: A Service to shorten URLs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: A Service to shorten URLs
Authored by: yesiamnhoj on Aug 27, '10 05:01:05AM

I'd use cURL in the Automator Applescript which is pre installed in OSX. You'd then not need the Perl script.

on run {input, parameters}
return (do shell script "/usr/bin/curl 'http://qgf.in/api.php?url=" & (item 1 of the input) & "'")
end run

Best wishes
John M



[ Reply to This | # ]
10.6: A Service to shorten URLs
Authored by: renaultssoftware on Aug 27, '10 05:27:52AM

I thought of doing that, but doesn't it download the webpage instead of reading the file? Or am I confused?

---
http://groups.google.com/group/applescripters/
http://qgf.in/
http://www.kompilesoft.info/



[ Reply to This | # ]
10.6: A Service to shorten URLs
Authored by: yesiamnhoj on Aug 27, '10 05:36:16AM

Without any options cURL returns the contents of the URL. In this case it would be the shortened URL.

John M



[ Reply to This | # ]
10.6: A Service to shorten URLs
Authored by: renaultssoftware on Aug 27, '10 05:52:11AM

Doggone it! I should've known. It would make the hint above that much easier. Why don't you submit that, saying it's an updated version? I'll give my permission, it's recorded here.

---
http://groups.google.com/group/applescripters/
http://qgf.in/
http://www.kompilesoft.info/



[ Reply to This | # ]
10.6: A Service to shorten URLs
Authored by: dclauzel on Sep 08, '10 02:12:16AM

There is even simpler : I am using Automator to directly run a UNIX script and to place the result into the system pasteboard. That skips the applescript part.

See this post for details.

[ Reply to This | # ]

10.6: A Service to shorten URLs
Authored by: philostein on Sep 08, '10 03:57:59AM
I wrote a Quicksilver action based on yesiamnhoj's Terminal command: cURL.scpt

Put it in ~/Library/Application Support/Quicksilver/Actions and relaunch Quicksilver.
Get a url in the first pane, press tab and find the 'cURL' action. Hit enter and get the shortened url in the clipboard and QS's first pane.

I find QS a lot faster than Automator for this kind of thing. Thanks to renaultssoftware for posting the hint, and to yesiamnhoj for the command. I've been looking for this for ages!

[ Reply to This | # ]