Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 107 lines (66 sloc) 2.961 kb
c78bba5 @grosser travis
grosser authored
1 MUSh [![Build Status](https://travis-ci.org/rafmagana/mush.png)](https://travis-ci.org/rafmagana/mush)
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
2 ====
07b0d3a @rafmagana Initial commit to mush.
authored
3
af59c77 @rafmagana updated README
authored
4 A multiple service URL shortener gem with command-line utilities
5
6 NOTE: This gem only supports url shortening, nothing else, no stats, no info, no expand and it won't support any of them.
7
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
8 Installation
9 ------------
a822a6b @rafmagana added installation to README
authored
10
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
11 MUSh depends on [HTTParty](https://github.com/jnunemaker/httparty "HTTParty")
c78bba5 @grosser travis
grosser authored
12
9663080 @rafmagana added development and runtime dependencies
authored
13 sudo gem install httparty
a822a6b @rafmagana added installation to README
authored
14 sudo gem install mush
15
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
16 or
c78bba5 @grosser travis
grosser authored
17
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
18 sudo gem install mush --include-dependencies
c78bba5 @grosser travis
grosser authored
19
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
20 Supported services
21 ------------------
22
23 * bit.ly
24 * is.gd
af59c77 @rafmagana updated README
authored
25
2c75302 @rafmagana add zaebz binary and add to list of supported services
authored
26 and thanks to [Noel Dellofano](https://github.com/pinkvelociraptor) from [ZenDesk](http://www.zendesk.com/):
af59c77 @rafmagana updated README
authored
27
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
28 * ow.ly
29 * custom service
af59c77 @rafmagana updated README
authored
30
2c75302 @rafmagana add zaebz binary and add to list of supported services
authored
31 and thanks to [Alex Rodionov](https://github.com/p0deje):
32
33 * zae.bz
34
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
35 Usage as a command line utility
36 -------------------------------
37
38 $ bitly -l login -k apikey -u http://foo.raflabs.com
af59c77 @rafmagana updated README
authored
39
40 $ isgd http://foo.raflabs.com
41
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
42 $ owly -k apikey -u foo.raflabs.com
43
2c75302 @rafmagana add zaebz binary and add to list of supported services
authored
44 $ zaebz http://foo.raflabs.com/
45
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
46 $ shorten -s "http://chop.ws/index.php?api=1&return_url_text=1&longUrl={{url}}" -u foo.raflabs.com
47
48 **NOTE:** _The 'shorten' command uses <code>Mush::Service::Custom</code> and currently it only works with services that accept 'get' as method (not 'post') and with services that return only the shortened url not a full html page_
af59c77 @rafmagana updated README
authored
49
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
50 Sorry, but at this moment, if you want to use the <code>bitly</code> or <code>owly</code> command line without apikey or login do this:
af59c77 @rafmagana updated README
authored
51
52 Add the following alias to your ~/.bash_profile or ~/.bashrc
53
54 alias bitly='bitly -l your_login -k your_apikey'
c78bba5 @grosser travis
grosser authored
55
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
56 alias owly='owly -k your_apikey'
af59c77 @rafmagana updated README
authored
57
58 then use it this way (you won't need the -u)
59
60 $ bitly http://google.com
61
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
62 $ owly http://google.com
63
64 Usage as a Gem
65 --------------
66
67 require 'rubygems' #in a Rails project you won't need this line
af59c77 @rafmagana updated README
authored
68 require 'mush'
69
70 bitly = Mush::Services::Bitly.new
71
72 bitly.login = "login"
73 bitly.apikey = "apikey"
74
75 bitly.shorten "http://foo.raflabs.com"
76
77 isgd = Mush::Services::IsGd.new
78 isgd.shorten "http://foo.raflabs.com"
79
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
80 custom = Mush::Services::Custom.new
81 custom.set_service = "http://chop.ws/index.php?api=1&return_url_text=1&longUrl={{url}}"
82 custom.shorten 'foo.raflabs.com'
c78bba5 @grosser travis
grosser authored
83
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
84 ToDo
85 ----
af59c77 @rafmagana updated README
authored
86
87 * Use bitly commmand without -l and -k, save config in home folder (.mush file)
88 * Make shorten method to accept multiple URLs
89 * add j.mp and maybe other services
90 * Cache
07b0d3a @rafmagana Initial commit to mush.
authored
91
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
92 Note on Patches/Pull Requests
93 -----------------------------
c78bba5 @grosser travis
grosser authored
94
07b0d3a @rafmagana Initial commit to mush.
authored
95 * Fork the project.
af59c77 @rafmagana updated README
authored
96 * Make your feature/service addition or bug fix.
07b0d3a @rafmagana Initial commit to mush.
authored
97 * Add tests for it. This is important so I don't break it in a
98 future version unintentionally.
99 * Commit, do not mess with rakefile, version, or history.
100 (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
101 * Send me a pull request. Bonus points for topic branches.
102
e72b93e @rafmagana add owly and custom service to README and changed to markdown format
authored
103 Copyright
104 ---------
07b0d3a @rafmagana Initial commit to mush.
authored
105
c78bba5 @grosser travis
grosser authored
106 Copyright (c) 2011 Rafael Magana. See LICENSE for details.
Something went wrong with that request. Please try again.