<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title>cortito - URL shortener by akosma software</title>
  <%= stylesheet_link_tag 'scaffold' %>
</head>
<body>
    
<h1><%= @host %> - URL shortener by <a href="http://akosma.com">akosma software</a></h1>

<%= yield %>

<hr />

<p><strong>Bookmarklet for your browser:</strong> <%= link_to "shorten with cortito", "javascript:location.href='http://" + @host + "/?url='+encodeURIComponent(location.href);" %> (drag and drop on your bookmark toolbar)</p>

<p><strong>API:</strong> Send a POST or GET request to <tt><%= @host %></tt> with a "url" parameter, with either an "Accept: application/javascript" or "Accept: text/xml" header. You'll get a simple text response with the shortened URL:</p>

<pre>$ curl --request GET --header "Accept: application/javascript" http://<%= @host %>/\?url=http://kosmaczewski.net/2008/08/11/saving-a-failing-project/
http://<%= @host %>/blzrur
$ _</pre>

You can also send a "reverse" parameter with the shortened key (not the whole URL, just the key) and you'll get the original URL in return:

<pre>$ curl --request GET --header "Accept: text/xml" http://<%= @host %>/\?reverse=blzrur<commit_msg>Same change as previously, to have a nicer bookmarklet<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title><%= @host %> - URL shortener by akosma software</title>
  <%= stylesheet_link_tag 'scaffold' %>
</head>
<body>
    
<h1><%= @host %> - URL shortener by <a href="http://akosma.com">akosma software</a></h1>

<%= yield %>

<hr />

<p><strong>Bookmarklet for your browser:</strong> <%= link_to "shorten with " + @host, "javascript:location.href='http://" + @host + "/?url='+encodeURIComponent(location.href);" %> (drag and drop on your bookmark toolbar)</p>

<p><strong>API:</strong> Send a POST or GET request to <tt><%= @host %></tt> with a "url" parameter, with either an "Accept: application/javascript" or "Accept: text/xml" header. You'll get a simple text response with the shortened URL:</p>

<pre>$ curl --request GET --header "Accept: application/javascript" http://<%= @host %>/\?url=http://kosmaczewski.net/2008/08/11/saving-a-failing-project/
http://<%= @host %>/blzrur
$ _</pre>

You can also send a "reverse" parameter with the shortened key (not the whole URL, just the key) and you'll get the original URL in return:

<pre>$ curl --request GET --header "Accept: text/xml" http://<%= @host %>/\?reverse=blzrur
{'fraction_non_alphanumeric': 0.19338159255429163, 'fraction_numerical': 0.015167183729748363, 'mean_word_length': 4.404096834264432, 'pattern_counts': {'":': 0, '<': 72, '<?xml version=': 0, '>': 72, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1341872', 'n_tokens_mistral': 1080, 'n_tokens_neox': 986, 'n_words': 284}