shawty-server 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +6 -0
- data/VERSION +1 -1
- data/shawty-server.gemspec +1 -1
- data/shawty.rb +12 -5
- metadata +1 -1
data/README.markdown
CHANGED
@@ -24,6 +24,12 @@ Imagine trying to fit that in a text message. Instead, how about:
|
|
24
24
|
|
25
25
|
http://url.myapp.com/a7D
|
26
26
|
|
27
|
+
But that's so hard, right? Nope. (see shawty-client for details):
|
28
|
+
|
29
|
+
Shawty.new("http://url.myapp.com/").shrink("http://myapp.com/accounts/megacorp/invoices?single_access_token=5ASD32ADf89JKASF2346")
|
30
|
+
# => http://url.myapp.com/a7D
|
31
|
+
## Saved on your url.myapp.com shawty server and usable immediately
|
32
|
+
|
27
33
|
Way groovy.
|
28
34
|
|
29
35
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
data/shawty-server.gemspec
CHANGED
data/shawty.rb
CHANGED
@@ -11,11 +11,18 @@ require 'alphadecimal'
|
|
11
11
|
## Application
|
12
12
|
|
13
13
|
get '/' do
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
%Q{
|
15
|
+
<body style='line-height: 1.8em; font-family: Archer, Museo, Helvetica, Georgia; font-size 25px; text-align: center; padding-top: 20%;'>
|
16
|
+
Post to '/' to save a url and receive a plaintext short url in response. Example:
|
17
|
+
<pre style='font-family: Iconsolata, monospace;background-color:#EEE'>curl -X POST http://#{request.host}/http://some.url/at.someplace</pre>
|
18
|
+
<br />
|
19
|
+
<form action=/ method=POST onsubmit='if(\"\"==this.url.value)return false;else{this.action=\"/\"+this.url.value}'>
|
20
|
+
<input type=text name='url' />
|
21
|
+
<input type=submit value='Get Shawty' />
|
22
|
+
</form>
|
23
|
+
<small>Also, try <a href='http://github.com/JackDanger/shawty-client'>the official Ruby client</a></small>
|
24
|
+
</body
|
25
|
+
}
|
19
26
|
end
|
20
27
|
|
21
28
|
get '/:id' do
|