]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - readme.html
Support for salted encrypted passwords. See issues 755 & 875.
[Github/YOURLS.git] / readme.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
3 <head>  \r
4         <meta http-equiv="X-UA-Compatible" content="chrome=1">\r
5         <meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
6         <title>YOURLS: Your Own URL Shortener</title>\r
7         <style type="text/css" media="screen">\r
8                 /* Default Style */\r
9                 body {\r
10                         font-family: Verdana, Arial;\r
11                         font-size: 12px;\r
12                         color: #595441;\r
13                         background:#E3F3FF;\r
14                         margin-top:0px;\r
15                 }\r
16                 p {\r
17                         padding-left: 10px;\r
18                 }\r
19                 code {\r
20                         background:#eaeaef;\r
21                         padding:0 2px;\r
22                 }\r
23                 tt {\r
24                         background:#ffc;\r
25                         padding:0 2px;          \r
26                 }\r
27                 pre tt {\r
28                         display:block;\r
29                 }\r
30                 blockquote {\r
31                         margin: 10px 20px 0px 20px;\r
32                         padding: 10px;\r
33                         border: 1px solid #8d8d8d;\r
34                         background-color: #f5f5f5;\r
35                 }\r
36                 li {\r
37                         margin-top: 20px;\r
38                 }\r
39                 ul li ul li {\r
40                         margin-top: 10px;\r
41                 }\r
42                 a, a:active, a:link, a:visited {\r
43                         color: #7ba7e4;\r
44                         text-decoration: none;\r
45                 }\r
46                 a:hover {\r
47                         color: #5577a5;\r
48                         text-decoration: underline;\r
49                 }\r
50                 div.sshot {\r
51                 }\r
52                 div.sshot p {\r
53                         color:#5577a5;\r
54                         font-size:90%;\r
55                 }\r
56                 div.sshot img {\r
57                         margin-bottom:1em;\r
58                         border-bottom:1px solid #ccc;\r
59                 }\r
60                 /* Place Holder Style */\r
61                 #Container {\r
62                         width: 950px;\r
63                         margin-left: auto;\r
64                         margin-right: auto; \r
65                 }\r
66                 #Content {\r
67                     background: none repeat scroll 0 0 white;\r
68                     border: 3px solid #2A85B3;\r
69                         -moz-border-radius:20px;\r
70                         -webkit-border-radius:20px;\r
71                     border-radius: 20px;\r
72                         margin-top:-13px;\r
73                     min-height: 150px;\r
74                     padding: 5px 20px 10px;\r
75                     text-align: left;\r
76                         border-radius:15px;\r
77                 }\r
78                 /* Title Style */\r
79                 h1{margin:0px}\r
80                 #Container h1 a {\r
81                         display:block;\r
82                         font-family: Verdana, Arial;\r
83                         font-size: 22px;\r
84                         font-weight: bold;\r
85                         color: #2A85B3;\r
86                         margin-top:0px;\r
87                         margin-bottom: 0px;\r
88                         background:transparent url(http://yourls.org/images/yourls-logo.png) left 5px no-repeat;\r
89                         padding-top:15px;\r
90                         height:80px;\r
91                         padding-left:220px;\r
92                         text-align:left;\r
93                 }\r
94                 h1 a:hover{text-decoration:none}\r
95                 h1 a:hover span {\r
96                         color: #88C0EB;\r
97                         text-decoration:underline;\r
98                 }\r
99                 h2 {\r
100                         font-family: Verdana, Arial;\r
101                         font-size: 18px;\r
102                         font-weight: bold;\r
103                         color: #5b87b4;\r
104                 }\r
105                 h2:before {\r
106                         content: '\00BB  ';\r
107                         color:#BFE0FE;\r
108                 }\r
109                 h3 {\r
110                         font-family: Verdana, Arial;\r
111                         font-size: 14px;\r
112                         font-weight: bold;\r
113                         color: #73a4d6;\r
114                         margin-top:2em;\r
115                 }\r
116                 h3:before {\r
117                         content: '\203A  ';\r
118                         color:#BFE0FE;\r
119                 }\r
120                 ul+h2 {\r
121                         margin-top:30px;\r
122                 }\r
123                 /* Tabs */\r
124                 ul#Tabs {\r
125                         font-family: Verdana, Arial;\r
126                         font-size: 12px;\r
127                         font-weight: bold;\r
128                         list-style-type: none;\r
129                         padding-bottom: 28px;\r
130                         border-bottom: 1px solid #2A85B3;\r
131                         margin:0 30px 12px 30px;\r
132                         z-index: 1;\r
133                 }\r
134                 #Tabs li.Tab {\r
135                         float: right;\r
136                         height: 25px;\r
137                         background-color: #deedfb;\r
138                         margin: 2px 0px 0px 5px;\r
139                         border: 1px solid #2A85B3;\r
140                         -webkit-border-top-left-radius: 10px;\r
141                         -webkit-border-top-right-radius: 10px;\r
142                         -moz-border-radius-topleft: 10px;\r
143                         -moz-border-radius-topright: 10px;\r
144                         border-top-left-radius: 10px;\r
145                         border-top-right-radius: 10px;\r
146                 }\r
147                 #Tabs li.Tab a {\r
148                         float: left;\r
149                         display: block;\r
150                         color: #666666;\r
151                         text-decoration: none;\r
152                         padding: 5px;\r
153                 }\r
154                 #Tabs li.Tab a:hover {\r
155                         background-color: #bfe0fe;\r
156                         -webkit-border-top-left-radius: 10px;\r
157                         -webkit-border-top-right-radius: 10px;\r
158                         -moz-border-radius-topleft: 10px;\r
159                         -moz-border-radius-topright: 10px;\r
160                         border-top-left-radius: 10px;\r
161                         border-top-right-radius: 10px;\r
162                 }\r
163                 /* Selected Tab */\r
164                 #Tabs li.SelectedTab {\r
165                         float: right;\r
166                         height: 25px;\r
167                         background-color: #fff;\r
168                         margin: 2px 0px 0px 5px;\r
169                         border-top: 1px solid #2A85B3;\r
170                         border-right: 1px solid #2A85B3;\r
171                         border-left: 1px solid #2A85B3;\r
172                         border-bottom: 4px solid #fff;\r
173                         -webkit-border-top-left-radius: 10px;\r
174                         -webkit-border-top-right-radius: 10px;\r
175                         -moz-border-radius-topleft: 10px;\r
176                         -moz-border-radius-topright: 10px;\r
177                         border-top-left-radius: 10px;\r
178                         border-top-right-radius: 10px;\r
179                 }\r
180                 #Tabs li.SelectedTab a {\r
181                         float: left;\r
182                         display: block;\r
183                         color: #666666;\r
184                         text-decoration: none;\r
185                         padding: 5px;\r
186                         cursor: default;\r
187                 }\r
188                 /* Copyright */\r
189                 #Copyright {\r
190                         text-align:center;\r
191                         margin-top:20px;\r
192                 }\r
193                 #Copyright p {\r
194                         padding:10px;\r
195                         background:white;\r
196                         margin:0 auto;\r
197                         width:750px;\r
198                         border:1px solid #2A85B3;\r
199                         -webkit-border-radius: 10px;\r
200                         -webkit-border-bottom-right-radius: 25px;\r
201                         -webkit-border-bottom-left-radius: 25px;\r
202                         -moz-border-radius: 10px;\r
203                         -moz-border-radius-bottomright: 30px;\r
204                         -moz-border-radius-bottomleft: 30px;\r
205                         border-radius: 10px;\r
206                         border-bottom-right-radius: 30px;\r
207                         border-bottom-left-radius: 30px;\r
208                 }\r
209                 #Copyright p a {\r
210                         background:#fff url(http://yourls.org/images/favicon.gif) 2px center no-repeat;\r
211                         padding-left:20px;\r
212                 }\r
213         </style>\r
214 </head>\r
215 <body>\r
216 <div id="Container">\r
217         <!-- Title -->\r
218         <h1><a href="http://yourls.org/">YOURLS: <span>Y</span>our <span>O</span>wn <span>URL</span> <span>S</span>hortener</a></h1>\r
219 \r
220         <!-- Tabs -->\r
221         <ul id="Tabs">\r
222                 <li id="MoreTab" class="Tab"><a href="#More" onclick="toggle(this);">More</a></li>\r
223                 <li id="FAQTab" class="Tab"><a href="#FAQ" onclick="toggle(this);">FAQ</a></li>\r
224                 <li id="APITab" class="Tab"><a href="#API" onclick="toggle(this);">API</a></li>\r
225                 <li id="PluginTab" class="Tab"><a href="#Plugin" onclick="toggle(this);">WordPress plugin</a></li>\r
226                 <li id="PluginsTab" class="Tab"><a href="#Plugins" onclick="toggle(this);">YOURLS plugins</a></li>\r
227                 <li id="ConfigTab" class="Tab"><a href="#Config" onclick="toggle(this);">Config</a></li>\r
228                 <li id="InstallTab" class="Tab"><a href="#Install" onclick="toggle(this);">Install/Upgrade</a></li>\r
229                 <li id="AboutTab" class="SelectedTab"><a href="#About" onclick="toggle(this);">About</a></li>\r
230         </ul>\r
231 \r
232         <!-- Content -->\r
233         <div id="Content">\r
234                 <!-- Index -->\r
235                 <div id="AboutDiv">\r
236                         <h2>About YOURLS</h2>\r
237                         \r
238                         <h3>What is YOURLS</h3>\r
239                         <p>YOURLS is a small set of PHP scripts that will allow you to run your own URL shortening service (<em>a la</em> TinyURL). You can make it private or public, you can pick custom keyword URLs, it comes with its own API. You will love it.</p>\r
240                         <p>There's a <a href="#Plugin" onclick="toggle(this);">WordPress plugin</a> available for YOURLS, making integration with your blog a snap: create short URLs and tweet them automagically as you publish blog posts.</p>\r
241                         \r
242                         <h3>YOURLS Features</h3>\r
243                         <ul>\r
244                                 <li><tt>Private</tt> (your links only) or <tt>Public</tt> (everybody can create short links, fine for an intranet)</li>\r
245                                 <li>Sequential or custom URL keyword</li>\r
246                                 <li>Handy <tt>bookmarklets</tt> to easily shorten and share links</li>\r
247                                 <li>Awesome <tt>stats</tt>: historical click reports, referrers tracking, visitors geo-location</li>\r
248                                 <li>Neat <tt>Ajaxed</tt> interface</li>\r
249                                 <li>Terrific <tt>Plugin</tt> architecture to easily implement new features</li>\r
250                                 <li>Cool developer <tt>API</tt></li>\r
251                                 <li>Full <tt>jsonp</tt> support</li>\r
252                                 <li>Friendly <tt>installer</tt></li>\r
253                                 <li><tt>Sample files</tt> to create your own public interface and more</li>\r
254                         </ul>\r
255                         \r
256                         <h3>Screenshots</h3>\r
257                         \r
258                         <div class="sshot">\r
259                                 <p>Main admin dashboard</p>\r
260                                 <img src="http://yourls.org/images/admin-dashboard.gif" />\r
261                                 \r
262                                 <p>Stats for each short URL</p>\r
263                                 <img src="http://yourls.org/images/stats-anim.gif" />\r
264                                 \r
265                                 <p>See a live example of YOURLS stats on <a href="http://yourls.org/download+">http://yourls.org/download+</a></p>\r
266                         </div>\r
267                         \r
268                         <h2>Download</h2>\r
269                         \r
270                         <p><a href="http://yourls.org/download">Download YOURLS</a> from Google Code</p>\r
271                         <p>You can follow YOURLS' development on the <a href="http://yourls.org/revisions">revision list</a> and get current snapshot <a href="http://yourls.org/svnco">using SVN</a></p>\r
272                         \r
273                         <h2>Credits</h2>\r
274                         \r
275                         <p>YOURLS is made by:</p>\r
276                         <ul>\r
277                                 <li><a href="http://yourls.org/lesterchan" title="Visit Lester Chan's site">Lester Chan</a> &ndash <a href="http://twitter.com/gamerz">@GamerZ</a> on Twitter (initial idea)</li>\r
278                                 <li><a href="http://yourls.org/ozh" title"Visit Ozh's site">Ozh Richard</a> &ndash <a href="http://twitter.com/ozh">@Ozh</a> on Twitter (development)</li>\r
279                         </ul>\r
280                         <p>Keep up to date: follow <a href="http://twitter.com/ozh">Ozh</a> and read the official <a href="http://blog.yourls.org/">YOURLS Blog</a></p>.\r
281                 </div>\r
282 \r
283                 <!-- Installation Instructions -->\r
284                 <div id="InstallDiv" style="display: none;">\r
285                         <h2>Fresh Install</h2>\r
286                         <ol>\r
287                                 <li>Unzip the YOURLS archive</li>\r
288                                 <li>Copy <code>user/config-sample.php</code> to <code>user/config.php</code></li>\r
289                                 <li>Open <code>user/config.php</code> with a raw text editor (like Notepad) and fill in the required settings</li>\r
290                                 <li>Upload the unzipped files to your domain <code>public_html</code> or <code>www</code> folder</li>\r
291                                 <li>Create a new database (see <a href="#Config" onclick="toggle(this);">Configuration</a> &ndash; you can also use an existing one)</li>\r
292                                 <li>Point your browser to <code>http://yoursite.com/admin/</code></li>\r
293                         </ol>\r
294                         \r
295                         <h2>Upgrade</h2>\r
296                         <ol>\r
297                                 <li><strong>Backup the database!</strong></li>\r
298                                 <li>Unzip the YOURLS archive</li>\r
299                                 <li>Upload files to your server, overwriting your existing install</li>\r
300                                 <li>Point your browser to <code>http://yoursite.com/admin/</code></li>\r
301                                 <li>Tip: you can now move your <code>config.php</code> file to the <code>/user</code> directory</li>\r
302                         </ol>\r
303                         \r
304                         <h2>Upgrade from YOURLS 1.3 or earlier</h2>\r
305                         <ol>\r
306                                 <li><strong>Backup the database!</strong></li>\r
307                                 <li>Make a copy of your <code>config.php</code></li>\r
308                                 <li>Delete all files including <code>.htaccess</code> in YOURLS root directory</li>\r
309                                 <li>Unzip the YOURLS archive, upload the files</li>\r
310                                 <li>Copy <code>config-sample.php</code> to <code>config.php</code> and fill in details. <strong>Don't start with your old config file</strong>, use the new sample config file.</li>\r
311                                 <li>In your new <code>config.php</code>, add the <em>defines</em> for <code>YOURLS_DB_TABLE_URL</code> and <code>YOURLS_DB_TABLE_NEXTDEC</code> you had in your previous config file\r
312                                 <li>Point your browser to <code>http://yoursite.com/admin/</code> and follow instructions</li>\r
313                                 <li>After upgrade is well and over, remove the define <code>YOURLS_DB_TABLE_NEXTDEC</code> from your config file</li>\r
314                         </ol>\r
315                         \r
316                 </div>\r
317 \r
318                 <!-- Configuration Instructions -->     \r
319                 <div id="ConfigDiv" style="display: none;">\r
320                         <h2>Configuration (in <code>user/config.php</code>)</h2>\r
321                         <h3>MySQL settings</h3>\r
322                         <ul>\r
323                                 <li><code>YOURLS_DB_USER</code><br/>\r
324                                 your MySQL username<br/>\r
325                                 <em>Example:</em> <tt>'joe'</tt></li>\r
326                                 <li><code>YOURLS_DB_PASS</code><br/>\r
327                                 your MySQL password<br/>\r
328                                 <em>Example:</em> <tt>'MySeCreTPaSsW0rd'</tt></li>\r
329                                 <li><code>YOURLS_DB_NAME</code>:\r
330                                 The database name<br/>\r
331                                 <em>Example:</em> <tt>'yourls'</tt></li>\r
332                                 <li><code>YOURLS_DB_HOST</code><br/>\r
333                                 The database host<br/>\r
334                                 <em>Example:</em> <tt>'localhost'</tt></li>\r
335                                 <li><code>YOURLS_DB_PREFIX</code><br/>\r
336                                 The name prefix for all the tables YOURLS will need<br/>\r
337                                 <em>Example:</em> <tt>'yourls_'</tt></li>\r
338                         </ul>\r
339                         \r
340                         <h3>Site options</h3>\r
341                         <ul>\r
342                                 <li><code>YOURLS_SITE</code><br/>\r
343                                 Your (short) domain URL, no trailing slash, lowercase. If you pick the non-www version of your domain, don't use the www version in your browser (and vice-versa)<br/>\r
344                                 <em>Example:</em> <tt>'http://ozh.in'</tt></li>\r
345                                 <li><code>YOURLS_HOURS_OFFSET</code><br/>\r
346                                 Timezone GMT offset<br/>\r
347                                 <em>Example:</em> <tt>'-5'</tt></li>\r
348                                 <li><code>YOURLS_PRIVATE</code><br/>\r
349                                 Private means the admin area will be protected with login/pass as defined below. See <a href="http://yourls.org/privatepublic">Private or Public</a> for more.<br/>\r
350                                 <em>Example:</em> <tt>'true'</tt></li>\r
351                                 <li><code>YOURLS_UNIQUE_URLS</code><br/>\r
352                                 Allow multiple short URLs for a same long URL<br/>\r
353                                 Set to <tt>true</tt> to allow only one pair of shortURL/longURL (default YOURLS behavior), or to <tt>false</tt> to allow creation of multiple short URLs pointing to the same long URL (as bit.ly does)<br/>\r
354                                 <em>Example:</em> <tt>'true'</tt></li>\r
355                                 <li><code>YOURLS_COOKIEKEY</code><br/>\r
356                                 A random secret hash used to encrypt cookies. You don't have to remember it, make it long and complicated. Hint: generate a unique one at <a href="http://yourls.org/cookie">http://yourls.org/cookie</a><br/>\r
357                                 <em>Example:</em> <tt>'qQ4KhL_pu|s@Zm7n#%:b^{A[vhm'</tt></li>\r
358                                 <li><code>yourls_user_passwords</code><br/>\r
359                                 A list of username(s) and password(s) allowed to access the site if private<br/>\r
360                                 Passwords can either be in plain text, or encrypted: see <a href="http://yourls.org/userpassword">http://yourls.org/userpassword</a> for more information<br/>\r
361                                 <em>Example:</em> <tt>'joe' => 'mypassword'</tt></li>\r
362                         </ul>\r
363                         \r
364                         <h3>URL Shortening settings</h3>\r
365                         <ul>\r
366                                 <li><code>YOURLS_URL_CONVERT</code><br/>\r
367                                 URL shortening method: base <tt>36</tt> or <tt>62</tt>. See <a onclick="toggle(this);" href="#FAQ">FAQ</a> for more explanations</li>\r
368                                 <li><code>yourls_reserved_URL</code><br/>\r
369                                 A list of reserved keywords that won't be used as short URLs. Define here negative, unwanted or potentially misleading keywords<br/>\r
370                                 <em>Example:</em> <tt>'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 'gay'</tt></li>\r
371                         </ul>\r
372                         \r
373                         <h3>Optional settings</h3>\r
374                         <ul>\r
375                                 <li><code>YOURLS_PRIVATE_INFOS</code><br/>\r
376                                 If <code>YOURLS_PRIVATE</code> is set to <tt>true</tt>, you can still make stat pages public. To do so, define with:<br/>\r
377                                 <tt>define('YOURLS_PRIVATE_INFOS', false);</tt>\r
378                                 </li>\r
379                                 <li><code>YOURLS_PRIVATE_API</code><br/>\r
380                                 If <code>YOURLS_PRIVATE</code> is set to <tt>true</tt>, you can still make your API public. To do so, define with:<br/>\r
381                                 <tt>define('YOURLS_PRIVATE_API', false);</tt>\r
382                                 <li><code>YOURLS_NOSTATS</code><br/>\r
383                                 If <code>YOURLS_NOSTATS</code> is set to <tt>true</tt>, redirects won't be logged and there will be not stats available.<br/>\r
384                                 </li>\r
385                         </ul>\r
386                         \r
387                         <h3>Advanced settings</h3>\r
388                         <p>File <code>includes/yourls-load.php</code> contains a few more undocumented but self explanatory and commented settings. Add them to your own <code>config.php</code> if you know what you're doing</p>\r
389                 </div>\r
390                 \r
391                 <!-- WordPress plugin -->\r
392                 <div id="PluginDiv" style="display:none">\r
393                         <h2>WordPress Plugin</h2>\r
394                         \r
395                         <h3>Features</h3>\r
396                         <ul>\r
397                                 <li>Generate short URLs for each new post or page</li>\r
398                                 <li>Generate short URLs for all your old posts and pages if wished</li>\r
399                                 <li>Send a tweet on your Twitter account with the post title and short URL as you publish them</li>\r
400                                 <li>Works if YOURLS is hosted on the same server or on a remote server</li>\r
401                         </ul>\r
402                         \r
403                         <h3>Screenshot</h3>\r
404                         <div class="sshot">\r
405                         <img src="http://yourls.org/images/wpplugin.gif"/>\r
406                         </div>\r
407                         \r
408                         <h3>Download &amp; more informations</h3>\r
409                         <ul>\r
410                                 <li>Download <a href="http://yourls.org/plugin">YOURLS: WordPress to Twitter</a> from the official WordPress plugin repository</li>\r
411                                 <li>More information, tips and feedback on <a href="http://yourls.org/plugindoc">the plugin page</a> from planetOzh</li>\r
412                         </ul>\r
413                 \r
414                 </div>\r
415                 \r
416                 <!-- YOURLS plugins -->\r
417                 <div id="PluginsDiv" style="display:none">\r
418                         <h2>Plugins for YOURLS</h2>\r
419                         \r
420                         <h3>Plugins?</h3>\r
421                         <p>Plugins are additional PHP scripts that extend the functionalities or features of YOURLS. The core of YOURLS is designed to be as light as possible and avoid bloat (implementing functions not everybody needs) and to allow for easy customization.</p>\r
422                         <p>Using the plugin architecture, you can add new features to YOURLS without having to modify core files. This way, your changes won't be lost when you upgrade your YOURLS installation.</p>\r
423                         <p>There's a growing number of plugins available: check the <a href="http://yourls.org/pluginlist">Plugin list</a>.</p>\r
424 \r
425                         <h3>Documentation</h3>\r
426                         <p>Several sample plugins are included in the archive. Read the source and learn the concept. It's easy and fun!</p>\r
427                         <p>Check the <a href="http://yourls.org/pluginapi">plugin API documentation</a> to learn more</p>\r
428                 \r
429                 </div>\r
430                 \r
431                 <!-- API -->\r
432                 <div id="APIDiv" style="display:none">\r
433                         <h2>YOURLS' API</h2>\r
434                         \r
435                         <h3>Features</h3>\r
436                         <ul>\r
437                                 <li>Generate or get existing short URLs, with sequential or custom keyword</li>\r
438                                 <li>Get some statistics about your links: top clicked links, least clicked links, newest links</li>\r
439                                 <li>Output format: JSON, XML, or simple raw text</li>\r
440                                 <li>Authentify either with login/password or using a secure passwordless mechanism</li>\r
441                         </ul>\r
442                         \r
443                         <h3>Usage</h3>\r
444                         <p>You need to send parameters to <code>http://yoursite.com/yourls-api.php</code> either via <code>GET</code> or <code>POST</code> (remember to URL encode parameters if via GET). These parameters are:</p>\r
445                         <ul>\r
446                                 <li>A valid <code>username</code> / <code>password</code> pair, or your <code>signature</code> (see <a href="http://yourls.org/passwordlessapi">Passwordless API requests</a>)</li>\r
447                                 <li>The requested <code>action</code>: <tt>"shorturl"</tt> (get short URL for a link), <tt>"expand"</tt> (get long URL of a shorturl), <tt>"url-stats"</tt> (get stats about one short URL), <tt>"stats"</tt> (get stats about your links) or <tt>"db-stats"</tt> (get global link and click count)</li>\r
448                                 <li>With <tt>action = "shorturl"</tt> :\r
449                                         <ul>\r
450                                                 <li>the <code>url</code> to shorten</li>\r
451                                                 <li>optional <code>keyword</code> for custom short URLs</li>\r
452                                                 <li>output <code>format</code>: either <tt>"json"</tt>, <tt>"xml"</tt> or <tt>"simple"</tt></li>\r
453                                         </ul>\r
454                                 </li>\r
455                                 <li>With <tt>action = "expand"</tt> :\r
456                                         <ul>\r
457                                                 <li>the <code>shorturl</code> to expand (can be either 'abc' or 'http://site/abc')</li>\r
458                                                 <li>output <code>format</code>: either <tt>"json"</tt>, <tt>"xml"</tt> or <tt>"simple"</tt></li>\r
459                                         </ul>\r
460                                 </li>\r
461                                 <li>With <tt>action = "url-stats"</tt> :\r
462                                         <ul>\r
463                                                 <li>the <code>shorturl</code> for which to get stats (can be either 'abc' or 'http://site/abc')</li>\r
464                                                 <li>output <code>format</code>: either <tt>"json"</tt> or <tt>"xml"</tt></li>\r
465                                         </ul>\r
466                                 </li>\r
467                                 <li>With <tt>action = "stats"</tt> :\r
468                                         <ul>\r
469                                                 <li>the <code>filter</code>: either <tt>"top"</tt>, <tt>"bottom"</tt> , <tt>"rand"</tt> or <tt>"last"</tt></li>\r
470                                                 <li>the <code>limit</code> (maximum number of links to return)</li>\r
471                                                 <li>output <code>format</code>: either <tt>"json"</tt> or <tt>"xml"</tt></li>\r
472                                         </ul>\r
473                                 </li>\r
474                                 <li>With <tt>action = "db-stats"</tt> :\r
475                                         <ul>\r
476                                                 <li>output <code>format</code>: either <tt>"json"</tt> or <tt>"xml"</tt></li>\r
477                                         </ul>\r
478                                 </li>\r
479                         </ul>\r
480                         \r
481                         <h3>Sample return</h3>\r
482                         <pre><tt>&lt;result&gt;\r
483         &lt;url&gt;\r
484                 &lt;keyword&gt;shorter&lt;/keyword&gt;\r
485                 &lt;url&gt;http://somereallylongurlyouneedtoshrink.com/&lt;/url&gt;\r
486                 &lt;title&gt;The Page Title&lt;/title&gt;\r
487                 &lt;date&gt;2009-06-23 18:08:07&lt;/date&gt;\r
488                 &lt;ip&gt;127.0.0.1&lt;/ip&gt;\r
489         &lt;/url&gt;\r
490         &lt;status&gt;success&lt;/status&gt;\r
491         &lt;message&gt;http://somereallylongurlyouneedtoshrink.com/ (ID: shorter) added to database&lt;/message&gt;\r
492         &lt;title&gt;The Page Title&lt;/title&gt;\r
493         &lt;shorturl&gt;http://yoursite.com/shorter&lt;/shorturl&gt;\r
494         &lt;statusCode&gt;200&lt;/statusCode&gt;\r
495 &lt;/result&gt;</tt></pre>\r
496 \r
497                         <h3>Sample file</h3>\r
498                         <p>There's a sample file included that serves as an example on how to play with the API</p>\r
499 \r
500                 </div>\r
501                 \r
502 \r
503                 <!-- FAQ Instructions -->       \r
504                 <div id="FAQDiv" style="display: none;">\r
505                         <h2>FAQ</h2>\r
506 \r
507                         <h3>Server requirements</h3>\r
508                         <ol>\r
509                                 <li>A server with <strong>mod_rewrite</strong> enabled</li>\r
510                                 <li>At least <strong>PHP 4.3</strong></li>\r
511                                 <li>At least <strong>MYSQL 4.1</strong></li>\r
512                                 <li><em>Note</em>: YOURLS can also run on <a href="http://foolrulez.org/blog/2009/08/foolz-us-make-yourls-work-on-ngin/">Nginx</a> and <a href="http://www.ututech.com/2010/10/configuring-yourls-to-work-with-cherokee-web-server/">Cherokee</a></li>\r
513                         </ol>\r
514 \r
515                         <h3>Server recommendations</h3>\r
516                         <ul>\r
517                                 <li>PHP <a href="http://www.php.net/curl">CURL extension</a> installed if you plan on playing with the API</li>\r
518                         </ul>\r
519                         \r
520                         <h3>Limitations</h3>\r
521                         <ul>\r
522                                 <li>Maximum length of long URLs to be shortened is <strong>2000 characters</strong></li>\r
523                                 <li>Maximum length of custom keyword is <strong>200 characters</strong></li>\r
524                                 <li>That makes about <strong>8 sexdecillions of centillions</strong> of available URLs (<a href="http://en.wikipedia.org/wiki/Names_of_large_numbers">seriously</a>. That's a 355 digits number). </li>\r
525                         </ul>\r
526                         \r
527                         <h3>Difference Between Base 36 And Base 62 Encoding</h3>\r
528                         <ul>\r
529                                 <li>Base 36 encoding uses <code>0123456789abcdefghijklmnopqrstuvwxyz</code> for short URLs</li>\r
530                                 <li>Base 62 encoding uses <code>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</code></li>\r
531                                 <li>Stick to one setting, don't change after you've created links as it will change all your short URLs!</li>\r
532                                 <li>Base 36 is the default and should be picked if you're not sure.</li>\r
533                         </ul>\r
534                         \r
535                         <h3>Getting a short domain name for your YOURLS install</h3>\r
536                         <ul>\r
537                                 <li>Unless you plan on making it public and popular, any shared hosting should be fine</li>\r
538                                 <li><a href="http://domai.nr/">Domainr</a> is a fun search tool that might inspire and help you</li>\r
539                                 <li>Aim for exotic top level domains (.in, .im, .li ...), they're often cheap and a lot are still available. <a href="https://www.gandi.net/domain/buy/search/">Gandi</a> is a pretty comprehensive registrar, for instance.</li>\r
540                         </ul>\r
541 \r
542                         <h3>YOURLS needs its own .htaccess</h3>\r
543                         <ul>\r
544                                 <li>You cannot install YOURLS and, say, WordPress, in the same directory. Both need to handle URLs differently and need their own <tt>.htaccess</tt> file.</li>\r
545                                 <li>If you want to install YOURLS on the same domain than your blog, give it its own (short) subdirectory, such as yourblog.com/s/ (for "short") or yourblog.com/x/ (for "exit")</li>\r
546                         </ul>\r
547                         \r
548                         <h3>If YOURLS generates 404 for your short URLs</h3>\r
549                         <ul>\r
550                                 <li>Make sure <strong>mod_rewrite</strong> is enabled with your Apache server</li>\r
551                                 <li>Make sure your .htaccess file looks like <a href="http://yourls.org/htaccess">this one</a></li>\r
552                         </ul>\r
553                         \r
554                         <h3>There is no index page at the root of the install</h3>\r
555                         <ul>\r
556                                 <li>Indeed. It's intented. It's up to the user to make what they need. Some will redirect the root to a different place, some make a public interface for anyone to shorten links, some make a portfolio. You make it.</li>\r
557                                 <li>If you want to make a public interface, there's a sample file provided as an example.</li>\r
558                         </ul>\r
559                         \r
560                         <h3>Feedback, feature requests and bug reporting</h3>\r
561                         <ul>\r
562                                 <li>Please don't get in touch directly by mail or Twitter. <a href="http://yourls.org/support">Please</a>.</li>\r
563                                 <li>Check the <a href="http://yourls.org/roadmap">Road Map</a> for future features.</li>\r
564                                 <li>Read all the <a href="http://yourls.org/wiki">wiki documents</a>.</li>\r
565                                 <li>Search in the <a href="http://yourls.org/closedissues">closed issues</a>.</li>\r
566                                 <li>Eventually raise an <a href="http://yourls.org/issues">issue here</a> and give all the details. Thanks!</li>\r
567                         </ul>\r
568 \r
569                 </div>\r
570                 \r
571                 \r
572                                 <!-- More -->   \r
573                 <div id="MoreDiv" style="display: none;">\r
574                 \r
575                         <h2>Community</h2>\r
576                         \r
577                         <p>YOURLS is open source, so the community of users plays a great role in its development, by contributing, helping others or giving feedback that helps improve the software.</p>\r
578                         \r
579                         <h3>Resources</h3>\r
580                         <ul>\r
581                                 <li>The official <a href="http://blog.yourls.org">YOURLS blog</a>, for news, hints and showcase.</li>\r
582                                 <li>The official <a href="http://blog.yourls.org/forums/">YOURLS forums</a>: show off, discuss ideas, announce your plugins, seek help.</li>\r
583                                 <li>The <a href="http://yourls.org/wiki">wiki</a>: advanced documentation, plugins, tips and more</li>\r
584                         </ul>\r
585                 \r
586                         <h2>Showcase</h2>\r
587 \r
588                         <h3>Here are a few examples of sites running YOURLS with a unique design or concept</h3>\r
589                         \r
590                         <ul>\r
591                                 <li><a href="http://mrte.ch/">http://mrte.ch/</a><br/>\r
592                                 Mr Tech's public YOURLS setup, listing top links and some stats</li>\r
593                                 <li><a href="http://xib.me/">http://xib.me/</a></br/>\r
594                                 A nicely styled YOURLS public interface</li>\r
595                                 <li><a href="http://girv.in/">http://girv.in/</a><br/>\r
596                                 John Girvin's YOURLS setup with all links in a sortable display</li>\r
597                                 <li><a href="http://rml.me/">http://rml.me/</a><br/>\r
598                                 A personal URL shortener front page showing new links and most clicked links</li>\r
599                                 <li><a href="http://6bit.us/">6Bit.us</a><br/>\r
600                                 A public YOURLS setup with a different approach: it offers widgets to embed in other sites</li>\r
601                                 <li><a href="http://vbly.us">http://vbly.us</a><br/>\r
602                                 Public YOURLS setup and early adopter, run by famous sex writer Violet Blue as "the internet's first and only sex-positive url shortener", once taken down by Libya (<a href="http://www.readwriteweb.com/archives/libya_shuts_down_vbly_bitly_owly_next.php">story</a>)</li>\r
603                         </ul>\r
604                         \r
605                         <h2>More stuff about or with YOURLS</h2>\r
606                         \r
607                         <ul>\r
608                                 <li><a href="http://screenr.com/nTs">http://screenr.com/nTs</a><br/>\r
609                                 A screencast explaining how to setup YOURLS</li>\r
610                                 \r
611                                 <li><a href="http://v007.me/836">YOURLS: Short URL Widget</a><br/>\r
612                                 Creates a fully configurable widget that outputs the short URL to the current post or page</li>\r
613                                 \r
614                                 <li><a href="http://foolrulez.org/blog/2009/09/yourls-widget-released">YOURLS Widget for WordPress</a><br/>\r
615                                 This widget adds a convenient short URL service into your sidebar. Check the above link for a live example</li>\r
616                                 \r
617                                 <li><a href="http://www.stewartallen.org/2010/08/yourls-twitter-tools-wordpress-plugin/">Twitter Tools & YOURLS</a><br/>\r
618                                 Companion plugin for Alex King's Twitter Tool for WordPress, that enables YOURLS support</li>\r
619                                 \r
620                                 <li><a href="http://github.com/pjain/WWW-Shorten-Yourls">WWW-Shorten-Yourls</a><br/>\r
621                                 A Perl module to shorten URLs using YOURLS</li>\r
622                                 \r
623                                 <li><a href="https://rubygems.org/gems/yourls">YOURLS Ruby</a><br/>\r
624                                 A Ruby wrapper for the YOURLS API</li>\r
625                                 \r
626                                 <li><a href="http://sharetronix.com/sharetronix/addons/view/41">Sharetronix</a><br/>\r
627                                 A YOURLS addon for Sharetronix</li>\r
628                                 \r
629                                 <li><a href="http://www.chrismarquardt.com/blog.php?id=7952283233607249761">Textexpander and YOURLS</a><br/>\r
630                                 Making YOURLS and Textexpander on the Mac play together</li>\r
631                                 \r
632                                 <li><a href="http://www.eugenegordin.com/etc/how-to-use-your-custom-yourls-shortener-with-tweetie-2.html">YOURLS and Tweetie 2</a><br/>\r
633                                 How to set up Tweetie2 so it uses your own service</li>\r
634                                 \r
635                                 <li><a href="http://remkusdevries.com/how-to-setup-tweetdeck-with-yourls/">YOURLS and TweetDeck</a><br/>\r
636                                 How to set up TweetDeck so it uses your own service</li>\r
637                                 \r
638                                 <li><a href="http://mt-hacks.com/AzaZ">YOURLS with Movable Type</a><br/>\r
639                                 Twitter Tools for Movable Type supports custom YOURLS setup</li>\r
640                                 \r
641                                 <li><a href="http://www.mrtech.com/forums/index.php/topic,2524.0.html">YOURLS hacks</a><br/>\r
642                                 Hacks to enhance YOURLS for spam control/throttling, unshortening and weekly stats\r
643                                 \r
644                                 <li><a href="http://code.google.com/p/yourls/issues/detail?id=137">Export URLS as text list</a><br/>\r
645                                 A simple script to list all URLs, one per line, in plain text (for using as an indexer config file, for example)</li>\r
646                                 \r
647                                 <li>YOURLS featured on <a href="http://lifehacker.com/5335216/make-your-own-url-shortening-service">Lifehacker</a></li>\r
648                         </ul>\r
649 \r
650                 </div>\r
651         </div> <!-- content -->\r
652 </div> <!-- container -->\r
653 \r
654 </p></div>\r
655 \r
656         <script type="text/javascript">\r
657         /* <![CDATA[*/\r
658         // Dynamically get tabs\r
659         function getTabs() {\r
660                 var d = document.getElementById('Tabs');\r
661                 var matches = d.innerHTML.match(/<li id="(.+?)Tab"/g);\r
662                 var tabs = []\r
663                 for (i in matches) {\r
664                   tabs[i]= matches[i].replace('<li id="','').replace('Tab"', '');\r
665                 }\r
666                 tabs = tabs.reverse();\r
667                 return (tabs)\r
668         }\r
669         // Toggle tab display\r
670         function toggle(el) {\r
671                 //var tabs = ["About", "Install", "Config", "Plugin", "FAQ"];\r
672                 var target = el.toString().replace(/^.*#/, '');\r
673                 for (var tab in tabs) {\r
674                         // reinit tabs\r
675                         document.getElementById(tabs[tab]+'Tab').className = 'Tab';\r
676                         // reinit divs\r
677                         document.getElementById(tabs[tab]+'Div').style.display= 'none';\r
678                 }\r
679                 // highlight & display target\r
680                 document.getElementById(target+'Div').style.display = 'block';\r
681                 document.getElementById(target+'Tab').className = 'SelectedTab';\r
682                 try { el.blur(); } catch(err) {}\r
683         }\r
684         // Get tab list\r
685         var tabs = getTabs();\r
686         // On page load/refresh display required tab\r
687         if (location.hash) {\r
688                 toggle(location.hash);\r
689         }\r
690         /* ]]> */\r
691         </script>\r
692 \r
693 \r
694 </body>\r
695 </html>