]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - readme.html
Readme update (showcase) and, while I'm at it, social and background fancyness.
[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                         zcolor:#5577a5;\r
54                         zfont-size:90%;\r
55                 }\r
56                 div.sshot img {\r
57                         margin-bottom:1em;\r
58                         border:1px solid #2A85B3;\r
59                         padding:10px;\r
60                         border-radius:10px;\r
61                 }\r
62                 #fade {\r
63                         position:absolute; background: #E3F3FF; width:100%; height:230px; top:0px; left:0px; z-index:-1;\r
64                         background: -webkit-gradient(linear, left top, left bottom, from(rgba(227, 243, 255, 1)), to(rgba(227, 243, 255, 0)));\r
65                         background: -moz-linear-gradient(top,  rgba(227, 243, 255, 1),  rgba(227, 243, 255, 0.1)); /* for firefox 3.6+ */ \r
66                 }\r
67                 #buttons{ width:80px; margin-top:10px; float:right; position:absolute; margin-left: 810px;}\r
68                 #fb,#g1,#tw{ float:left; margin:0 5px; width: 60px; text-align: center; margin-bottom: 10px; padding:7px 2px; border:2px solid #2A85B3; background: #E3F3FF; border-radius:10px;}\r
69                 #fb span {width:50px !important}\r
70 \r
71                 /* Place Holder Style */\r
72                 #Container {\r
73                         width: 850px;\r
74                         margin-left: auto;\r
75                         margin-right: auto;\r
76                         z-index:1337;\r
77                 }\r
78                 #Content {\r
79                     background: none repeat scroll 0 0 white;\r
80                     border: 3px solid #2A85B3;\r
81                         -moz-border-radius:20px;\r
82                         -webkit-border-radius:20px;\r
83                     border-radius: 20px;\r
84                         margin-top:-13px;\r
85                     min-height: 150px;\r
86                     padding: 5px 20px 10px;\r
87                     text-align: left;\r
88                         border-radius:15px;\r
89                 }\r
90                 /* Title Style */\r
91                 h1{margin:0px}\r
92                 #Container h1 a {\r
93                         display:block;\r
94                         font-family: Verdana, Arial;\r
95                         font-size: 22px;\r
96                         font-weight: bold;\r
97                         color: #2A85B3;\r
98                         margin-top:0px;\r
99                         margin-bottom: 0px;\r
100                         background:transparent url(http://yourls.org/images/yourls-logo.png) left 5px no-repeat;\r
101                         padding-top:15px;\r
102                         height:80px;\r
103                         padding-left:220px;\r
104                         text-align:left;\r
105                 }\r
106                 h1 a:hover{text-decoration:none}\r
107                 h1 a:hover span {\r
108                         color: #88C0EB;\r
109                         text-decoration:underline;\r
110                 }\r
111                 h2 {\r
112                         font-family: Verdana, Arial;\r
113                         font-size: 18px;\r
114                         font-weight: bold;\r
115                         color: #5b87b4;\r
116                         margin-top:50px;\r
117                 }\r
118                 h2.first{margin-top:10px}\r
119                 h2:before {\r
120                         content: '\00BB  ';\r
121                         color:#BFE0FE;\r
122                 }\r
123                 h3 {\r
124                         font-family: Verdana, Arial;\r
125                         font-size: 14px;\r
126                         font-weight: bold;\r
127                         color: #73a4d6;\r
128                         margin-top:2em;\r
129                 }\r
130                 h3:before {\r
131                         content: '\203A  ';\r
132                         color:#BFE0FE;\r
133                 }\r
134                 /* Tabs */\r
135                 ul#Tabs {\r
136                         font-family: Verdana, Arial;\r
137                         font-size: 12px;\r
138                         font-weight: bold;\r
139                         list-style-type: none;\r
140                         padding-bottom: 28px;\r
141                         border-bottom: 1px solid #2A85B3;\r
142                         margin:0 30px 12px 30px;\r
143                         z-index: 1;\r
144                 }\r
145                 #Tabs li.Tab {\r
146                         float: right;\r
147                         height: 25px;\r
148                         background-color: #deedfb;\r
149                         margin: 2px 0px 0px 5px;\r
150                         border: 1px solid #2A85B3;\r
151                         -webkit-border-top-left-radius: 10px;\r
152                         -webkit-border-top-right-radius: 10px;\r
153                         -moz-border-radius-topleft: 10px;\r
154                         -moz-border-radius-topright: 10px;\r
155                         border-top-left-radius: 10px;\r
156                         border-top-right-radius: 10px;\r
157                 }\r
158                 #Tabs li.Tab a {\r
159                         float: left;\r
160                         display: block;\r
161                         color: #666666;\r
162                         text-decoration: none;\r
163                         padding: 5px;\r
164                 }\r
165                 #Tabs li.Tab a:hover {\r
166                         background-color: #bfe0fe;\r
167                         -webkit-border-top-left-radius: 10px;\r
168                         -webkit-border-top-right-radius: 10px;\r
169                         -moz-border-radius-topleft: 10px;\r
170                         -moz-border-radius-topright: 10px;\r
171                         border-top-left-radius: 10px;\r
172                         border-top-right-radius: 10px;\r
173                 }\r
174                 /* Selected Tab */\r
175                 #Tabs li.SelectedTab {\r
176                         float: right;\r
177                         height: 25px;\r
178                         background-color: #fff;\r
179                         margin: 2px 0px 0px 5px;\r
180                         border-top: 1px solid #2A85B3;\r
181                         border-right: 1px solid #2A85B3;\r
182                         border-left: 1px solid #2A85B3;\r
183                         border-bottom: 4px solid #fff;\r
184                         -webkit-border-top-left-radius: 10px;\r
185                         -webkit-border-top-right-radius: 10px;\r
186                         -moz-border-radius-topleft: 10px;\r
187                         -moz-border-radius-topright: 10px;\r
188                         border-top-left-radius: 10px;\r
189                         border-top-right-radius: 10px;\r
190                 }\r
191                 #Tabs li.SelectedTab a {\r
192                         float: left;\r
193                         display: block;\r
194                         color: #666666;\r
195                         text-decoration: none;\r
196                         padding: 5px;\r
197                         cursor: default;\r
198                 }\r
199                 /* Copyright */\r
200                 #Copyright {\r
201                         text-align:center;\r
202                         margin-top:20px;\r
203                 }\r
204                 #Copyright p {\r
205                         padding:10px;\r
206                         background:white;\r
207                         margin:0 auto;\r
208                         width:750px;\r
209                         border:1px solid #2A85B3;\r
210                         -webkit-border-radius: 10px;\r
211                         -webkit-border-bottom-right-radius: 25px;\r
212                         -webkit-border-bottom-left-radius: 25px;\r
213                         -moz-border-radius: 10px;\r
214                         -moz-border-radius-bottomright: 30px;\r
215                         -moz-border-radius-bottomleft: 30px;\r
216                         border-radius: 10px;\r
217                         border-bottom-right-radius: 30px;\r
218                         border-bottom-left-radius: 30px;\r
219                 }\r
220                 #Copyright p a {\r
221                         background:#fff url(http://yourls.org/images/favicon.gif) 2px center no-repeat;\r
222                         padding-left:20px;\r
223                 }\r
224         </style>\r
225         <!--[if IE]> <style>#fade{display:none}</style> <![endif]-->\r
226 </head>\r
227 <body>\r
228 <div id="fb-root"></div>\r
229 <div id="Container">\r
230 \r
231         <!-- Title -->\r
232         <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
233 \r
234         <!-- Tabs -->\r
235         <ul id="Tabs">\r
236                 <li id="MoreTab" class="Tab"><a href="#More" onclick="toggle(this);">More</a></li>\r
237                 <li id="FAQTab" class="Tab"><a href="#FAQ" onclick="toggle(this);">FAQ</a></li>\r
238                 <li id="APITab" class="Tab"><a href="#API" onclick="toggle(this);">API</a></li>\r
239                 <li id="PluginTab" class="Tab"><a href="#Plugin" onclick="toggle(this);">WordPress plugin</a></li>\r
240                 <li id="PluginsTab" class="Tab"><a href="#Plugins" onclick="toggle(this);">YOURLS plugins</a></li>\r
241                 <li id="ConfigTab" class="Tab"><a href="#Config" onclick="toggle(this);">Config</a></li>\r
242                 <li id="InstallTab" class="Tab"><a href="#Install" onclick="toggle(this);">Install/Upgrade</a></li>\r
243                 <li id="AboutTab" class="SelectedTab"><a href="#About" onclick="toggle(this);">About</a></li>\r
244         </ul>\r
245 \r
246         <!-- Content -->\r
247         <div id="Content">\r
248 \r
249                 <div id="buttons">\r
250                         <div id="fb">\r
251                         <div class="fb-like" data-href="http://yourls.org/" data-send="false" data-layout="box_count" data-width="60" data-show-faces="true" data-font="verdana"></div>\r
252                         \r
253 <script>(function(d, s, id) {\r
254   var js, fjs = d.getElementsByTagName(s)[0];\r
255   if (d.getElementById(id)) return;\r
256   js = d.createElement(s); js.id = id;\r
257   js.src = "https://connect.facebook.net/en_US/all.js#xfbml=1&appId=125474947598196";\r
258   fjs.parentNode.insertBefore(js, fjs);\r
259 }(document, 'script', 'facebook-jssdk'));</script>\r
260                         </div>\r
261                         <div id="g1">\r
262                         <div class="g-plusone" data-size="tall" data-href="http://yourls.org/"></div>\r
263                         <script type="text/javascript">(function(){var po=document.createElement('script');po.type='text/javascript';po.async=true;po.src='https://apis.google.com/js/plusone.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(po,s);})();</script>\r
264                         </div>\r
265                         <div id="tw">\r
266                         <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://yourls.org" data-via="ozh" data-lang="en" data-related="YOURLS" data-count="vertical">Tweet</a>\r
267                         <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>\r
268                         </div>\r
269                 </div>\r
270 \r
271                 <!-- Index -->\r
272                 <div id="AboutDiv">\r
273                         <h2 class='first'>About YOURLS</h2>\r
274                         \r
275                         <h3>What is YOURLS</h3>\r
276                         <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
277                         <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
278                         \r
279                         <h3>YOURLS Features</h3>\r
280                         <ul>\r
281                                 <li><tt>Private</tt> (your links only) or <tt>Public</tt> (everybody can create short links, fine for an intranet)</li>\r
282                                 <li>Sequential or custom URL keyword</li>\r
283                                 <li>Handy <tt>bookmarklets</tt> to easily shorten and share links</li>\r
284                                 <li>Awesome <tt>stats</tt>: historical click reports, referrers tracking, visitors geo-location</li>\r
285                                 <li>Neat <tt>Ajaxed</tt> interface</li>\r
286                                 <li>Terrific <tt>Plugin</tt> architecture to easily implement new features</li>\r
287                                 <li>Cool developer <tt>API</tt></li>\r
288                                 <li>Full <tt>jsonp</tt> support</li>\r
289                                 <li>Friendly <tt>installer</tt></li>\r
290                                 <li><tt>Sample files</tt> to create your own public interface and more</li>\r
291                         </ul>\r
292                         \r
293                         <h3>Screenshots</h3>\r
294                         \r
295                         <div class="sshot">\r
296                                 <p>Main admin dashboard</p>\r
297                                 <img src="http://yourls.org/yourls-org-images/admin-dashboard.gif" />\r
298                                 \r
299                                 <p>Stats for each short URL</p>\r
300                                 <img src="http://yourls.org/yourls-org-images/stats-anim.gif" />\r
301                                 \r
302                                 <p>See a live example of YOURLS stats on <a href="http://yourls.org/cookie+">http://yourls.org/cookie+</a></p>\r
303                         </div>\r
304                         \r
305                         <h2>Download</h2>\r
306                         \r
307                         <p><a href="http://yourls.org/download">Download YOURLS</a> from Google Code</p>\r
308                         <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
309                         \r
310                         <h2>Credits</h2>\r
311                         \r
312                         <p>YOURLS is made by:</p>\r
313                         <ul>\r
314                                 <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
315                                 <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
316                         </ul>\r
317                         <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
318                 </div>\r
319 \r
320                 <!-- Installation Instructions -->\r
321                 <div id="InstallDiv" style="display: none;">\r
322                         <h2 class='first'>Fresh Install</h2>\r
323                         <ol>\r
324                                 <li>Unzip the YOURLS archive</li>\r
325                                 <li>Copy <code>user/config-sample.php</code> to <code>user/config.php</code></li>\r
326                                 <li>Open <code>user/config.php</code> with a raw text editor (like Notepad) and fill in the required settings</li>\r
327                                 <li>Upload the unzipped files to your domain <code>public_html</code> or <code>www</code> folder</li>\r
328                                 <li>Create a new database (see <a href="#Config" onclick="toggle(this);">Configuration</a> &ndash; you can also use an existing one)</li>\r
329                                 <li>Point your browser to <code>http://yoursite.com/admin/</code></li>\r
330                         </ol>\r
331                         \r
332                         <h2>Upgrade</h2>\r
333                         <ol>\r
334                                 <li><strong>Backup the database!</strong></li>\r
335                                 <li>Unzip the YOURLS archive</li>\r
336                                 <li>Upload files to your server, overwriting your existing install</li>\r
337                                 <li>Point your browser to <code>http://yoursite.com/admin/</code></li>\r
338                                 <li>Tip: you can now move your <code>config.php</code> file to the <code>/user</code> directory</li>\r
339                         </ol>\r
340                         \r
341                         <h2>Upgrade from YOURLS 1.3 or earlier</h2>\r
342                         <ol>\r
343                                 <li><strong>Backup the database!</strong></li>\r
344                                 <li>Make a copy of your <code>config.php</code></li>\r
345                                 <li>Delete all files including <code>.htaccess</code> in YOURLS root directory</li>\r
346                                 <li>Unzip the YOURLS archive, upload the files</li>\r
347                                 <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
348                                 <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
349                                 <li>Point your browser to <code>http://yoursite.com/admin/</code> and follow instructions</li>\r
350                                 <li>After upgrade is well and over, remove the define <code>YOURLS_DB_TABLE_NEXTDEC</code> from your config file</li>\r
351                         </ol>\r
352                         \r
353                 </div>\r
354 \r
355                 <!-- Configuration Instructions -->     \r
356                 <div id="ConfigDiv" style="display: none;">\r
357                         <h2 class='first'>Configuration (in <code>user/config.php</code>)</h2>\r
358                         <h3>MySQL settings</h3>\r
359                         <ul>\r
360                                 <li><code>YOURLS_DB_USER</code><br/>\r
361                                 your MySQL username<br/>\r
362                                 <em>Example:</em> <tt>'joe'</tt></li>\r
363                                 <li><code>YOURLS_DB_PASS</code><br/>\r
364                                 your MySQL password<br/>\r
365                                 <em>Example:</em> <tt>'MySeCreTPaSsW0rd'</tt></li>\r
366                                 <li><code>YOURLS_DB_NAME</code>:\r
367                                 The database name<br/>\r
368                                 <em>Example:</em> <tt>'yourls'</tt></li>\r
369                                 <li><code>YOURLS_DB_HOST</code><br/>\r
370                                 The database host<br/>\r
371                                 <em>Example:</em> <tt>'localhost'</tt></li>\r
372                                 <li><code>YOURLS_DB_PREFIX</code><br/>\r
373                                 The name prefix for all the tables YOURLS will need<br/>\r
374                                 <em>Example:</em> <tt>'yourls_'</tt></li>\r
375                         </ul>\r
376                         \r
377                         <h3>Site options</h3>\r
378                         <ul>\r
379                                 <li><code>YOURLS_SITE</code><br/>\r
380                                 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
381                                 <em>Example:</em> <tt>'http://ozh.in'</tt></li>\r
382                                 <li><code>YOURLS_HOURS_OFFSET</code><br/>\r
383                                 Timezone GMT offset<br/>\r
384                                 <em>Example:</em> <tt>'-5'</tt></li>\r
385                                 <li><code>YOURLS_PRIVATE</code><br/>\r
386                                 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
387                                 <em>Example:</em> <tt>'true'</tt></li>\r
388                                 <li><code>YOURLS_UNIQUE_URLS</code><br/>\r
389                                 Allow multiple short URLs for a same long URL<br/>\r
390                                 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
391                                 <em>Example:</em> <tt>'true'</tt></li>\r
392                                 <li><code>YOURLS_COOKIEKEY</code><br/>\r
393                                 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
394                                 <em>Example:</em> <tt>'qQ4KhL_pu|s@Zm7n#%:b^{A[vhm'</tt></li>\r
395                                 <li><code>yourls_user_passwords</code><br/>\r
396                                 A list of username(s) and password(s) allowed to access the site if private<br/>\r
397                                 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
398                                 <em>Example:</em> <tt>'joe' => 'mypassword'</tt></li>\r
399                         </ul>\r
400                         \r
401                         <h3>URL Shortening settings</h3>\r
402                         <ul>\r
403                                 <li><code>YOURLS_URL_CONVERT</code><br/>\r
404                                 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
405                                 <li><code>yourls_reserved_URL</code><br/>\r
406                                 A list of reserved keywords that won't be used as short URLs. Define here negative, unwanted or potentially misleading keywords<br/>\r
407                                 <em>Example:</em> <tt>'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 'gay'</tt></li>\r
408                         </ul>\r
409                         \r
410                         <h3>Optional settings</h3>\r
411                         <ul>\r
412                                 <li><code>YOURLS_PRIVATE_INFOS</code><br/>\r
413                                 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
414                                 <tt>define('YOURLS_PRIVATE_INFOS', false);</tt>\r
415                                 </li>\r
416                                 <li><code>YOURLS_PRIVATE_API</code><br/>\r
417                                 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
418                                 <tt>define('YOURLS_PRIVATE_API', false);</tt>\r
419                                 <li><code>YOURLS_NOSTATS</code><br/>\r
420                                 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
421                                 </li>\r
422                         </ul>\r
423                         \r
424                         <h3>Advanced settings</h3>\r
425                         <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
426                 </div>\r
427                 \r
428                 <!-- WordPress plugin -->\r
429                 <div id="PluginDiv" style="display:none">\r
430                         <h2 class='first'>WordPress Plugin</h2>\r
431                         \r
432                         <h3>Features</h3>\r
433                         <ul>\r
434                                 <li>Generate short URLs for each new post or page</li>\r
435                                 <li>Generate short URLs for all your old posts and pages if wished</li>\r
436                                 <li>Send a tweet on your Twitter account with the post title and short URL as you publish them</li>\r
437                                 <li>Works if YOURLS is hosted on the same server or on a remote server</li>\r
438                         </ul>\r
439                         \r
440                         <h3>Download &amp; more informations</h3>\r
441                         <ul>\r
442                                 <li>Download <a href="http://yourls.org/plugin">YOURLS: WordPress to Twitter</a> from the official WordPress plugin repository</li>\r
443                                 <li>More information, tips and feedback on <a href="http://yourls.org/plugindoc">the plugin page</a> from planetOzh</li>\r
444                         </ul>\r
445                 \r
446                 </div>\r
447                 \r
448                 <!-- YOURLS plugins -->\r
449                 <div id="PluginsDiv" style="display:none">\r
450                         <h2 class='first'>Plugins for YOURLS</h2>\r
451                         \r
452                         <h3>Plugins?</h3>\r
453                         <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
454                         <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 and you can easily activate and deactivate a plugin from the admin interface.</p>\r
455                         <p>There's a growing number of plugins available: check the <a href="http://yourls.org/pluginlist">Plugin list</a>.</p>\r
456 \r
457                         <h3>Documentation</h3>\r
458                         <p>Several sample plugins are included in the archive. Read the source and learn the concept. It's easy and fun!</p>\r
459                         <p>Check the <a href="http://yourls.org/pluginapi">plugin API documentation</a> to learn more</p>\r
460                 \r
461                 </div>\r
462                 \r
463                 <!-- API -->\r
464                 <div id="APIDiv" style="display:none">\r
465                         <h2 class='first'>YOURLS' API</h2>\r
466                         \r
467                         <h3>Features</h3>\r
468                         <ul>\r
469                                 <li>Generate or get existing short URLs, with sequential or custom keyword</li>\r
470                                 <li>Get some statistics about your links: top clicked links, least clicked links, newest links</li>\r
471                                 <li>Output format: JSON, XML, or simple raw text</li>\r
472                                 <li>Authentify either with login/password or using a secure passwordless mechanism</li>\r
473                         </ul>\r
474                         \r
475                         <h3>Usage</h3>\r
476                         <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
477                         <ul>\r
478                                 <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
479                                 <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
480                                 <li>With <tt>action = "shorturl"</tt> :\r
481                                         <ul>\r
482                                                 <li>the <code>url</code> to shorten</li>\r
483                                                 <li>optional <code>keyword</code> for custom short URLs</li>\r
484                                                 <li>output <code>format</code>: either <tt>"json"</tt>, <tt>"xml"</tt> or <tt>"simple"</tt></li>\r
485                                         </ul>\r
486                                 </li>\r
487                                 <li>With <tt>action = "expand"</tt> :\r
488                                         <ul>\r
489                                                 <li>the <code>shorturl</code> to expand (can be either 'abc' or 'http://site/abc')</li>\r
490                                                 <li>output <code>format</code>: either <tt>"json"</tt>, <tt>"xml"</tt> or <tt>"simple"</tt></li>\r
491                                         </ul>\r
492                                 </li>\r
493                                 <li>With <tt>action = "url-stats"</tt> :\r
494                                         <ul>\r
495                                                 <li>the <code>shorturl</code> for which to get stats (can be either 'abc' or 'http://site/abc')</li>\r
496                                                 <li>output <code>format</code>: either <tt>"json"</tt> or <tt>"xml"</tt></li>\r
497                                         </ul>\r
498                                 </li>\r
499                                 <li>With <tt>action = "stats"</tt> :\r
500                                         <ul>\r
501                                                 <li>the <code>filter</code>: either <tt>"top"</tt>, <tt>"bottom"</tt> , <tt>"rand"</tt> or <tt>"last"</tt></li>\r
502                                                 <li>the <code>limit</code> (maximum number of links to return)</li>\r
503                                                 <li>output <code>format</code>: either <tt>"json"</tt> or <tt>"xml"</tt></li>\r
504                                         </ul>\r
505                                 </li>\r
506                                 <li>With <tt>action = "db-stats"</tt> :\r
507                                         <ul>\r
508                                                 <li>output <code>format</code>: either <tt>"json"</tt> or <tt>"xml"</tt></li>\r
509                                         </ul>\r
510                                 </li>\r
511                         </ul>\r
512                         \r
513                         <h3>Sample return</h3>\r
514                         <pre><tt>&lt;result&gt;\r
515         &lt;url&gt;\r
516                 &lt;keyword&gt;shorter&lt;/keyword&gt;\r
517                 &lt;url&gt;http://somereallylongurlyouneedtoshrink.com/&lt;/url&gt;\r
518                 &lt;title&gt;The Page Title&lt;/title&gt;\r
519                 &lt;date&gt;2009-06-23 18:08:07&lt;/date&gt;\r
520                 &lt;ip&gt;127.0.0.1&lt;/ip&gt;\r
521         &lt;/url&gt;\r
522         &lt;status&gt;success&lt;/status&gt;\r
523         &lt;message&gt;http://somereallylongurlyouneedtoshrink.com/ (ID: shorter) added to database&lt;/message&gt;\r
524         &lt;title&gt;The Page Title&lt;/title&gt;\r
525         &lt;shorturl&gt;http://yoursite.com/shorter&lt;/shorturl&gt;\r
526         &lt;statusCode&gt;200&lt;/statusCode&gt;\r
527 &lt;/result&gt;</tt></pre>\r
528 \r
529                         <h3>Sample file</h3>\r
530                         <p>There's a sample file included that serves as an example on how to play with the API</p>\r
531 \r
532                 </div>\r
533                 \r
534 \r
535                 <!-- FAQ Instructions -->       \r
536                 <div id="FAQDiv" style="display: none;">\r
537                         <h2 class='first'>FAQ</h2>\r
538 \r
539                         <h3>Server requirements</h3>\r
540                         <ol>\r
541                                 <li>A server with <strong>mod_rewrite</strong> enabled</li>\r
542                                 <li>At least <strong>PHP 4.3</strong></li>\r
543                                 <li>At least <strong>MYSQL 4.1</strong></li>\r
544                                 <li><em>Note</em>: YOURLS can also run on <a href="http://www.packetcollision.com/2012/01/27/yourls-and-nginx-an-updated-config/">Nginx</a> and <a href="http://www.ututech.com/2010/10/configuring-yourls-to-work-with-cherokee-web-server/">Cherokee</a></li>\r
545                         </ol>\r
546 \r
547                         <h3>Server recommendations</h3>\r
548                         <ul>\r
549                                 <li>PHP <a href="http://www.php.net/curl">CURL extension</a> installed if you plan on playing with the API</li>\r
550                         </ul>\r
551                         \r
552                         <h3>Limitations</h3>\r
553                         <ul>\r
554                                 <li>Maximum length of long URLs to be shortened is <strong>2000 characters</strong></li>\r
555                                 <li>Maximum length of custom keyword is <strong>200 characters</strong></li>\r
556                                 <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
557                         </ul>\r
558                         \r
559                         <h3>Difference Between Base 36 And Base 62 Encoding</h3>\r
560                         <ul>\r
561                                 <li>Base 36 encoding uses <code>0123456789abcdefghijklmnopqrstuvwxyz</code> for short URLs</li>\r
562                                 <li>Base 62 encoding uses <code>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</code></li>\r
563                                 <li>Stick to one setting, don't change after you've created links as it will change all your short URLs!</li>\r
564                                 <li>Base 36 is the default and should be picked if you're not sure.</li>\r
565                         </ul>\r
566                         \r
567                         <h3>Getting a short domain name for your YOURLS install</h3>\r
568                         <ul>\r
569                                 <li>Unless you plan on making it public and as popular as bit.ly, any shared hosting will be fine. Ozh runs all his YOURLS instance on <a href="http://www.dreamhost.com/r.cgi?114740">Dreamhost</a> and it works just great.</li>\r
570                                 <li><a href="http://domai.nr/">Domainr</a> is a fun search tool that might inspire and help you</li>\r
571                                 <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
572                         </ul>\r
573 \r
574                         <h3>YOURLS needs its own .htaccess</h3>\r
575                         <ul>\r
576                                 <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
577                                 <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
578                         </ul>\r
579                         \r
580                         <h3>If YOURLS generates 404 for your short URLs</h3>\r
581                         <ul>\r
582                                 <li>Make sure <strong>mod_rewrite</strong> is enabled with your Apache server</li>\r
583                                 <li>Make sure your .htaccess file looks like <a href="http://yourls.org/htaccess">this one</a></li>\r
584                         </ul>\r
585                         \r
586                         <h3>There is no index page at the root of the install</h3>\r
587                         <ul>\r
588                                 <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
589                                 <li>If you want to make a public interface, there's a sample file provided as an example.</li>\r
590                         </ul>\r
591                         \r
592                         <h3>Feedback, feature requests and bug reporting</h3>\r
593                         <ul>\r
594                                 <li>Please don't get in touch directly by mail or Twitter. <a href="http://yourls.org/support">Please</a>.</li>\r
595                                 <li>Check the <a href="http://yourls.org/roadmap">Road Map</a> for future features.</li>\r
596                                 <li>Read all the <a href="http://yourls.org/wiki">wiki documents</a>.</li>\r
597                                 <li>Search in the <a href="http://yourls.org/closedissues">closed issues</a>.</li>\r
598                                 <li>Eventually raise an <a href="http://yourls.org/issues">issue here</a> and give all the details. Thanks!</li>\r
599                         </ul>\r
600 \r
601                 </div>\r
602                 \r
603                 \r
604                 <!-- More -->   \r
605                 <div id="MoreDiv" style="display: none;">\r
606                 \r
607                         <h2 class='first'>Community</h2>\r
608                         \r
609                         <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
610                         \r
611                         <h3>Resources</h3>\r
612                         <ul>\r
613                                 <li>The official <a href="http://blog.yourls.org">YOURLS blog</a>, for news, hints and showcase.</li>\r
614                                 <li>The <a href="http://yourls.org/wiki">wiki</a>: advanced documentation, plugins, tips and more</li>\r
615                                 <li>Follow <a href="https://twitter.com/YOURLS">@YOURLS</a> to get the scoops on development, and <a href="https://twitter.com/ozh">@Ozh</a> for tips and news (and random geekiness too)</li>\r
616                         </ul>\r
617                 \r
618                         <h2>Showcase</h2>\r
619 \r
620                         <h3>Here are a few examples of sites running YOURLS with a unique design or concept</h3>\r
621                         <ul>\r
622                                 <li><a href="http://mrte.ch/">http://mrte.ch/</a><br/>\r
623                                 Mr Tech's public YOURLS setup, listing top links and some stats</li>\r
624                                 \r
625                                 <li><a href="http://freze.it/">http://freze.it/</a></br/>\r
626                                 Shortens and saves a screenshot of a long URL</li>\r
627                                 \r
628                                 <li><a href="http://xib.me/">http://xib.me/</a></br/>\r
629                                 A nicely styled YOURLS public interface</li>\r
630                                 \r
631                                 <li><a href="http://girv.in/">http://girv.in/</a><br/>\r
632                                 John Girvin's YOURLS setup with all links in a sortable display (and its <a href="https://github.com/johngirvin/yourls-index-page">source</a>)</li>\r
633                                 \r
634                                 <li><a href="http://rml.me/">http://rml.me/</a><br/>\r
635                                 A personal URL shortener front page showing new links and most clicked links</li>\r
636                                 \r
637                                 <li><a href="http://vt802.us/">http://vt802.us/</a><br/>\r
638                                 Defined as "The World's First Vermont-centric URL Shortener"</li>\r
639                                 \r
640                                 <li><a href="http://yourwish.es/">http://yourwish.es/</a><br/>\r
641                                 Easily share an Amazon wishlist</li>\r
642                                 \r
643                                 <li><a href="http://vbly.us">http://vbly.us</a><br/>\r
644                                 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
645                         </ul>\r
646                         \r
647                         <h2>YOURLS and other platforms or frameworks</h2>\r
648                         <ul>            \r
649                                 <li><a href="http://github.com/pjain/WWW-Shorten-Yourls">Perl</a><br/>\r
650                                 WWW-Shorten-Yourls is a Perl module to shorten URLs using YOURLS</li>\r
651                                 \r
652                                 <li><a href="https://github.com/threestage/yourls">Ruby</a><br/>\r
653                                 A Ruby wrapper for the YOURLS API</li>\r
654                                 \r
655                                 <li><a href="http://tflink.github.com/python-yourls/">Python</a><br/>\r
656                                 A Python client for YOURLS</li>\r
657                                 \r
658                                 <li><a href="http://neocotic.com/yourls-api/">Javascript</a><br/>\r
659                                 JavaScript bindings for the YOURLS API to leverage JSONP support</li>\r
660 \r
661                                 <li><a href="https://github.com/driflash/CakePHP-YOURLS-Plugin">CakePHP</a><br/>\r
662                                 Plugin which integrates CakePHP with Yourls</li>\r
663                                 \r
664                                 <li><a href="http://drupal.org/project/yourls">Drupal</a><br/>\r
665                                 Allows for the automatic creation of short urls using a YOURLS installation</li>\r
666                                 \r
667                                 <li><a href="https://github.com/rthees/yourls-status-net">status.net</a><br/>\r
668                                 A plugin for status.net to use YOURLS</li>\r
669                                 \r
670                                 <li><a href="http://developer.sharetronix.com/mpview/12/tag:yourls">Sharetronix</a><br/>\r
671                                 A YOURLS addon for Sharetronix</li>\r
672                                 \r
673                         </ul>\r
674                                 \r
675                         <h2>YOURLS works with your favorite sofware or device</h2>\r
676                         <ul>\r
677                                 <li><a href="http://www.eugenegordin.com/etc/how-to-use-your-custom-yourls-shortener-with-tweetie-2.html">Tweetie 2</a><br/>\r
678                                 How to set up Tweetie2 so it uses your own service</li>\r
679                                 \r
680                                 <li><a href="http://remkusdevries.com/how-to-setup-tweetdeck-with-yourls/">TweetDeck</a><br/>\r
681                                 Set up TweetDeck to run with YOURLS</li>\r
682                                 \r
683                                 <li><a href="http://2fatdads.com/2012/02/how-to-make-yourls-org-work-in-tweetbot/">Tweetbot</a><br/>\r
684                                 Make Tweetbot run with YOURLS</li>\r
685                                 \r
686                                 <li><a href="http://christophe.rousee.fr/plugin-yourls-pour-seesmic-desktop-2">Seesmic</a><br/>\r
687                                 Use YOURLS with Seesmic</li>\r
688                                 \r
689                                 <li><a href="http://blog.yourls.org/2011/09/how-to-use-twitterfeed-with-your-custom-yourls-url-shortener/">Twitterfeed</a><br/>\r
690                                 Use Twitterfeed with YOURLS</li>\r
691 \r
692                                 <li><a href="http://timi.im/app/">Mac Client</a><br/>\r
693                                 Simple app to have a global keyboard shortcut send a link to YOURLS</li>\r
694 \r
695                                 <li><a href="https://play.google.com/store/apps/details?id=com.mndroid.apps.urly">Android</a><br/>\r
696                                 URLy is an Android app that plays nice with YOURLS</li>\r
697 \r
698                                 <li><a href="http://itunes.apple.com/us/app/clicklytics-track-clicks-on/id444008024?mt=8">iOS</a><br/>\r
699                                 Clicklytics track links using YOURLS on iPhone and iPad</li>\r
700 \r
701                                 <li><a href="https://github.com/ukoms/Chrourls">Chrourls</a><br/>\r
702                                 Google Chrome quick link shortening addon for YOURLS</li>\r
703 \r
704                                 <li><a href="https://addons.mozilla.org/en-us/firefox/addon/yourls-shortener/">Firefox Addon</a><br/>\r
705                                 Firefox Addon for YOURLS</li>\r
706 \r
707                                 <li><a href="http://www.chrismarquardt.com/blog.php?id=7952283233607249761">Textexpander and YOURLS</a><br/>\r
708                                 Making YOURLS and Textexpander on the Mac play together</li>\r
709                         </ul>\r
710 \r
711                         <h2>More stuff to do with YOURLS</h2>\r
712                         <ul>\r
713                                 \r
714                                 <li><a href="https://github.com/tomslominski/infinity-squared">Infinity Squared</a><br/>\r
715                                 &#8734;&sup2; is a public page theme for YOURLS to help you design your own public interface</li>\r
716                                 \r
717                                 <li><a href="https://github.com/johngirvin/yourls-index-page">John Girvin's page</a><br/>\r
718                                 The source of http://girv.in/ home page</li>\r
719                                 \r
720                                 <li><a href="https://github.com/ctrloptcmd/xs.ht">xs.ht</a><br/>\r
721                                 An example front end page for YOURLS</li>\r
722                                 \r
723                                 <li><a href="http://screenr.com/nTs">http://screenr.com/nTs</a><br/>\r
724                                 A screencast explaining how to setup YOURLS</li>\r
725                                 \r
726                                 <li><a href="http://v007.me/836">YOURLS: Short URL Widget</a><br/>\r
727                                 Creates a fully configurable widget that outputs the short URL to the current post or page</li>\r
728                                 \r
729                                 <li><a href="http://foolrulez.org/blog/2009/09/yourls-widget-released">YOURLS Widget for WordPress</a><br/>\r
730                                 This widget adds a convenient short URL service into your sidebar. Check the above link for a live example</li>\r
731                                 \r
732                                 <li><a href="http://www.stewartallen.org/2010/08/yourls-twitter-tools-wordpress-plugin/">Twitter Tools & YOURLS</a><br/>\r
733                                 Companion plugin for Alex King's Twitter Tool for WordPress, that enables YOURLS support</li>\r
734                                 \r
735                                 <li><a href="http://code.google.com/p/yourls/issues/detail?id=137">Export URLS as text list</a><br/>\r
736                                 A simple script to list all URLs, one per line, in plain text (for using as an indexer config file, for example)</li>\r
737                                 \r
738                                 <li>YOURLS featured on <a href="http://lifehacker.com/5335216/make-your-own-url-shortening-service">Lifehacker</a></li>\r
739                         </ul>\r
740 \r
741                         <h2>"Celebrity endorsements", sort of.</h2>\r
742                         <ul>\r
743                                 \r
744                                 <li><a href="http://ithem.es/">http://ithem.es/</a> by <a href="http://www.ithemes.com/">iThemes</a></li>\r
745                                 \r
746                                 <li><a href="http://virg.in/">http://virg.in/</a> for the <a href="http://www.virgin.com/">Virgin Group companies</a></li>\r
747                                 \r
748                                 <li><a href="http://dhurl.org/">http://dhurl.org/</a> by <a href="http://www.dreamhost.com/">Dreamhost</a></li>\r
749                                 \r
750                         </ul>\r
751                                 \r
752                                 \r
753                 </div>\r
754         </div> <!-- content -->\r
755 </div> <!-- container -->\r
756 \r
757 <div id="fade"></div>\r
758 \r
759         <script type="text/javascript">\r
760         /* <![CDATA[*/\r
761         // Dynamically get tabs\r
762         function getTabs() {\r
763                 var d = document.getElementById('Tabs');\r
764                 var matches = d.innerHTML.match(/<li id="(.+?)Tab"/g);\r
765                 var tabs = []\r
766                 for (i in matches) {\r
767                   tabs[i]= matches[i].replace('<li id="','').replace('Tab"', '');\r
768                 }\r
769                 tabs = tabs.reverse();\r
770                 return (tabs)\r
771         }\r
772         // Toggle tab display\r
773         function toggle(el) {\r
774                 //var tabs = ["About", "Install", "Config", "Plugin", "FAQ"];\r
775                 var target = el.toString().replace(/^.*#/, '');\r
776                 for (var tab in tabs) {\r
777                         // reinit tabs\r
778                         document.getElementById(tabs[tab]+'Tab').className = 'Tab';\r
779                         // reinit divs\r
780                         document.getElementById(tabs[tab]+'Div').style.display= 'none';\r
781                 }\r
782                 // highlight & display target\r
783                 document.getElementById(target+'Div').style.display = 'block';\r
784                 document.getElementById(target+'Tab').className = 'SelectedTab';\r
785                 randbg();\r
786                 try { el.blur(); } catch(err) {}\r
787         }\r
788         // Get tab list\r
789         var tabs = getTabs();\r
790         // On page load/refresh display required tab\r
791         if (location.hash) {\r
792                 toggle(location.hash);\r
793         }\r
794         // Background fancyness\r
795         function randbg(){\r
796                 var rndbg = [ 'bg_ants.png', 'bg_circles.png', 'bg_cross.png', 'bg_diag.png', 'bg_fuzzy.png', 'bg_yourls.png' ];\r
797                 var bg = rndbg[ Math.floor( Math.random() * rndbg.length ) ];\r
798                 document.body.style.background='#E3F3FF url(user/plugins/random-bg/img/'+bg+')';\r
799         };\r
800         randbg();\r
801         /* ]]> */\r
802         </script>\r
803 \r
804 \r
805 </body>\r
806 </html>