]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - readme.html
Add plain API format
[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">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3 <head>  
4         <meta http-equiv="X-UA-Compatible" content="IE-9"/>
5         <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6         <title>YOURLS: Your Own URL Shortener</title>
7         <link href='https://fonts.googleapis.com/css?family=Fira+Sans:400,700' rel='stylesheet' type='text/css'>
8         <style type="text/css" media="screen">
9                 /* Default Style */
10                 body {
11                         font-family: Verdana, Arial, sans-serif;
12                         font-size: 12px;
13                         color: #595441;
14                         background:#E3F3FF;
15                         margin-top:0px;
16                         margin-bottom:30px;
17                 }
18                 p {
19                         padding-left: 10px;
20                 }
21                 code {
22                         background:#eaeaef;
23                         padding:0 2px;
24                 }
25                 tt {
26                         background:#ffc;
27                         padding:0 2px;          
28                 }
29                 pre tt {
30                         display:block;
31                 }
32                 blockquote {
33                         margin: 10px 20px 0px 20px;
34                         padding: 10px;
35                         border: 1px solid #8d8d8d;
36                         background-color: #f5f5f5;
37                 }
38                 li {
39                         margin-top: 20px;
40                 }
41                 ul li ul li {
42                         margin-top: 10px;
43                 }
44                 a, a:active, a:link, a:visited {
45                         color: #7ba7e4;
46                         text-decoration: none;
47                 }
48                 a:hover {
49                         color: #5577a5;
50                         text-decoration: underline;
51                 }
52                 div.sshot {
53                 }
54                 div.sshot p {
55                         zcolor:#5577a5;
56                         zfont-size:90%;
57                 }
58                 div.sshot img {
59                         margin-bottom:1em;
60                         border:1px solid #2A85B3;
61                         padding:10px;
62                         border-radius:10px;
63                 }
64                 #fade {
65                         position:absolute; background: #E3F3FF; width:100%; height:230px; top:0px; left:0px; z-index:-1;
66                         background: -webkit-gradient(linear, left top, left bottom, from(rgba(227, 243, 255, 1)), to(rgba(227, 243, 255, 0)));
67                         background: -moz-linear-gradient(top,  rgba(227, 243, 255, 1),  rgba(227, 243, 255, 0.1)); /* for firefox 3.6+ */ 
68                 }
69                 /* Social */
70                 @keyframes mymove { 0% {top:130px;} 50% {top:150px;} 100% {top:130px;} }
71                 @-moz-keyframes mymove { 0% {top:130px;} 50% {top:135px;} 100% {top:130px;} }
72                 @-webkit-keyframes mymove { 0% {top:130px;} 50% {top:140px;} 100% {top:130px;} }
73                 @-o-keyframes mymove { 0% {top:130px;} 50% {top:135px;} 100% {top:130px;} }
74                 #buttons{
75                         width:80px; margin-top:10px; float:right; position:absolute; margin-left: 810px;
76                         animation:mymove 0.5s ease 5s 7;
77                         -moz-animation:mymove 0.5s ease 5s 7;
78                         -webkit-animation:mymove 0.5s ease 5s 7;
79                         -o-animation:mymove 0.5s ease 5s 7;
80                 }
81                 #fb,#g1,#tw{ float:left; margin:0 5px; width: 60px; height:63px; text-align: center; margin-bottom: 10px; padding:7px 2px; border:2px solid #2A85B3; background: #E3F3FF; border-radius:10px;}
82                 #fb span {width:50px !important}
83                 #fb .fb_iframe_widget iframe{position:relative}
84                 /* Place Holder Style */
85                 #Container {
86                         width: 850px;
87                         margin-left: auto;
88                         margin-right: auto;
89                         z-index:1337;
90                 }
91                 #Content {
92                     background: none repeat scroll 0 0 white;
93                     border: 3px solid #2A85B3;
94                         -moz-border-radius:20px;
95                         -webkit-border-radius:20px;
96                     border-radius: 20px;
97                         margin-top:-13px;
98                     min-height: 150px;
99                     padding: 5px 20px 10px;
100                     text-align: left;
101                         z-index:2;
102                 }
103                 /* Title Style */
104                 h1{margin:0px}
105                 #Container h1 a {
106                         display:block;
107                         font-family: 'Fira Sans', Verdana, Arial;
108                         font-size: 32px;
109                         font-weight: 700;
110                         color: #2A85B3;
111                         margin-top:0px;
112                         margin-bottom: 0px;
113                         background:transparent url(https://yourls.org/images/yourls-logo.png) left 5px no-repeat;
114                         padding-top:15px;
115                         height:80px;
116                         padding-left:220px;
117                         text-align:left;
118                 }
119                 h1 a:hover{text-decoration:none}
120                 h1 a:hover span {
121                         color: #88C0EB;
122                         text-decoration:underline;
123                 }
124                 h2 {
125                         font-family: 'Fira Sans', Verdana, Arial;
126                         font-size: 22px;
127                         font-weight: 700;
128                         color: #5b87b4;
129                         margin-top:50px;
130                 }
131                 h2.first{margin-top:10px}
132                 h2:before {
133                         content: '\00BB  ';
134                         color:#BFE0FE;
135                 }
136                 h3 {
137                         font-family: 'Fira Sans', Verdana, Arial;
138                         font-size: 18px;
139                         font-weight: bold;
140                         color: #73a4d6;
141                         margin-top:2em;
142                 }
143                 h3:before {
144                         content: '\203A  ';
145                         color:#BFE0FE;
146                 }
147                 /* Tabs */
148                 ul#Tabs {
149                         font-family: Verdana, Arial;
150                         font-size: 13px;
151                         font-weight: 400;
152                         list-style-type: none;
153                         padding-bottom: 28px;
154                         border-bottom: 1px solid #2A85B3;
155                         margin:0 30px 12px 30px;
156                         z-index: 1;
157                 }
158                 #Tabs li.Tab {
159                         float: right;
160                         height: 23px;
161                         background-color: #deedfb;
162                         margin: 3px 0px 0px 5px;
163                         border: 2px solid #2A85B3;
164                         -webkit-border-top-left-radius: 10px;
165                         -webkit-border-top-right-radius: 10px;
166                         -moz-border-radius-topleft: 10px;
167                         -moz-border-radius-topright: 10px;
168                         border-top-left-radius: 10px;
169                         border-top-right-radius: 10px;
170                 }
171                 #Tabs li.Tab a {
172                         float: left;
173                         display: block;
174                         color: #666666;
175                         text-decoration: none;
176                         padding: 3px 5px;
177                 }
178                 #Tabs li.Tab a:hover {
179                         background-color: #bfe0fe;
180                         -webkit-border-top-left-radius: 10px;
181                         -webkit-border-top-right-radius: 10px;
182                         -moz-border-radius-topleft: 10px;
183                         -moz-border-radius-topright: 10px;
184                         border-top-left-radius: 10px;
185                         border-top-right-radius: 10px;
186                 }
187                 /* Selected Tab */
188                 #Tabs li.SelectedTab {
189                         float: right;
190                         height: 24px;
191                         background-color: #fff;
192                         margin: 0px 0px 0px 5px;
193                         border-top: 2px solid #2A85B3;
194                         border-right: 2px solid #2A85B3;
195                         border-left: 2px solid #2A85B3;
196                         border-bottom: 6px solid #fff;
197                         -webkit-border-top-left-radius: 10px;
198                         -webkit-border-top-right-radius: 10px;
199                         -moz-border-radius-topleft: 10px;
200                         -moz-border-radius-topright: 10px;
201                         border-top-left-radius: 10px;
202                         border-top-right-radius: 10px;
203                 }
204                 #Tabs li.SelectedTab a {
205                         float: left;
206                         display: block;
207                         color: #666666;
208                         text-decoration: none;
209                         padding: 5px;
210                         cursor: default;
211                 }
212                 /* Copyright */
213                 #Copyright {
214                         text-align:center;
215                         margin-top:20px;
216                 }
217                 #Copyright p {
218                         padding:10px;
219                         background:white;
220                         margin:0 auto;
221                         width:750px;
222                         border:1px solid #2A85B3;
223                         -webkit-border-radius: 10px;
224                         -webkit-border-bottom-right-radius: 25px;
225                         -webkit-border-bottom-left-radius: 25px;
226                         -moz-border-radius: 10px;
227                         -moz-border-radius-bottomright: 30px;
228                         -moz-border-radius-bottomleft: 30px;
229                         border-radius: 10px;
230                         border-bottom-right-radius: 30px;
231                         border-bottom-left-radius: 30px;
232                 }
233                 #Copyright p a {
234                         background:#fff url(https://yourls.org/images/favicon.gif) 2px center no-repeat;
235                         padding-left:20px;
236                 }
237         </style>
238         <!--[if IE]> <style>#fade{display:none}</style> <![endif]-->
239 </head>
240 <body>
241 <div id="fb-root"></div>
242 <div id="Container">
243
244         <!-- Title -->
245         <header role="banner">
246         <h1><a href="http://yourls.org/">YOURLS: <span>Y</span>our <span>O</span>wn <span>URL</span> <span>S</span>hortener</a></h1>
247         </header>
248         
249         <main role="main">
250         <!-- Tabs -->
251         <ul id="Tabs">
252                 <li id="MoreTab" class="Tab"><a href="#More" onclick="toggle(this);">More</a></li>
253                 <li id="FAQTab" class="Tab"><a href="#FAQ" onclick="toggle(this);">FAQ</a></li>
254                 <li id="APITab" class="Tab"><a href="#API" onclick="toggle(this);">API</a></li>
255                 <li id="PluginsTab" class="Tab"><a href="#Plugins" onclick="toggle(this);">YOURLS plugins</a></li>
256                 <li id="ConfigTab" class="Tab"><a href="#Config" onclick="toggle(this);">Config</a></li>
257                 <li id="InstallTab" class="Tab"><a href="#Install" onclick="toggle(this);">Install/Upgrade</a></li>
258                 <li id="AboutTab" class="SelectedTab"><a href="#About" onclick="toggle(this);">About</a></li>
259         </ul>
260
261         <!-- Content -->
262         <div id="Content">
263
264                 <div id="buttons">
265                         <div id="fb">
266                         <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>
267                         
268 <script>(function(d, s, id) {
269   var js, fjs = d.getElementsByTagName(s)[0];
270   if (d.getElementById(id)) return;
271   js = d.createElement(s); js.id = id;
272   js.src = "https://connect.facebook.net/en_US/all.js#xfbml=1&appId=125474947598196";
273   fjs.parentNode.insertBefore(js, fjs);
274 }(document, 'script', 'facebook-jssdk'));</script>
275                         </div>
276                         <div id="g1">
277                         <div class="g-plusone" data-size="tall" data-href="http://yourls.org/"></div>
278                         <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>
279                         </div>
280                         <div id="tw">
281                         <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>
282                         <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>
283                         </div>
284                 </div>
285
286                 <!-- Index -->
287                 <div id="AboutDiv">
288                         <h2 class='first'>About YOURLS</h2>
289                         
290                         <h3 id="what">What is YOURLS</h3>
291                         <p><strong>YOURLS</strong> stands for <strong>Your Own URL Shortener</strong>. It is a small set of PHP scripts that will allow you to run your own URL shortening service (<em>a la</em> TinyURL or bitly).</p>
292                         
293                         <p>Running your own URL shortener is fun, geeky and useful: you own your data and don't depend on third party services. It's also a great way to add branding to your short URLs, instead of using the same public URL shortener everyone uses.</p>
294                         
295                         <h3 id="features">YOURLS Features</h3>
296                         <ul>
297                                 <li><tt>Free</tt> and <tt>Open Source</tt> software.</li>
298                                 <li><tt>Private</tt> (your links only) or <tt>Public</tt> (everybody can create short links, fine for an intranet)</li>
299                                 <li>Sequential or custom URL keyword</li>
300                                 <li>Handy <tt>bookmarklets</tt> to easily shorten and share links</li>
301                                 <li>Awesome <tt>stats</tt>: historical click reports, referrers tracking, visitors geo-location</li>
302                                 <li>Neat <tt>Ajaxed</tt> interface</li>
303                                 <li>Terrific <tt>Plugin</tt> architecture to easily implement new features</li>
304                                 <li>Cool developer <tt>API</tt></li>
305                                 <li>Full <tt>jsonp</tt> support</li>
306                                 <li>Friendly <tt>installer</tt></li>
307                                 <li><tt>Sample files</tt> to create your own public interface and more</li>
308                         </ul>
309                         
310                         <h3 id="screenshots">Screenshots</h3>
311                         
312                         <div class="sshot">
313                                 <p>Main admin dashboard</p>
314                                 <img src="https://yourls.org/yourls-org-images/admin-dashboard.gif" />
315                                 
316                                 <p>Stats for each short URL</p>
317                                 <img src="https://yourls.org/yourls-org-images/stats-anim.gif" />
318                                 
319                                 <p>See a live example of YOURLS stats on <a href="http://yourls.org/cookie+">http://yourls.org/cookie+</a></p>
320                         </div>
321                         
322                         <h2 id="download">Download</h2>
323                         
324                         <p><a href="http://yourls.org/download">Download YOURLS</a> from Github</p>
325                         <p>You can follow YOURLS' development on the <a href="http://yourls.org/revisions">commit history</a> and get <a href="https://github.com/YOURLS/YOURLS/archive/master.zip">current development build</a></p>
326                         
327                         <h2 id="credits">Credits</h2>
328                         
329                         <p>YOURLS is made by <a href="https://github.com/YOURLS/YOURLS/graphs/contributors">awesome people</a>.</p>
330
331                         <p>Keep up to date: follow <a href="http://twitter.com/yourls">@yourls</a>, <a href="http://twitter.com/ozh">@ozh</a> (lead developer)and read the official <a href="http://blog.yourls.org/">YOURLS Blog</a></p>
332                 </div>
333
334                 <!-- Installation Instructions -->
335                 <div id="InstallDiv" style="display: none;">
336                         <h2 class='first' id="fresh">Fresh Install</h2>
337                         <ol>
338                                 <li>Unzip the YOURLS archive</li>
339                                 <li>Copy <code>user/config-sample.php</code> to <code>user/config.php</code></li>
340                                 <li>Open <code>user/config.php</code> with a raw text editor (like Notepad) and fill in the required settings</li>
341                                 <li>Upload the unzipped files to your domain <code>public_html</code> or <code>www</code> folder</li>
342                                 <li>Create a new database (see <a href="#Config" onclick="toggle(this);">Configuration</a> &ndash; you can also use an existing one)</li>
343                                 <li>Point your browser to <code>http://your-own-domain-here.com/admin/</code></li>
344                         </ol>
345                         <a href="https://www.rosehosting.com/blog/how-to-install-yourls-on-ubuntu-14-04/">How to Install YOURLS on Ubuntu 14.04</a> (Unoficial guide) <br/>
346                         <a href="https://thishosting.rocks/how-to-shorten-your-links-with-your-own-domain/#vps">How to Install YOURLS on CentOS 7</a> (Unoficial guide) <br/>
347                         <a href="https://thishosting.rocks/how-to-shorten-your-links-with-your-own-domain/#shared">How to Install YOURLS on Shared hosting (cPanel)</a> (Unoficial guide) 
348                         <h2 id="upgrade">Upgrade</h2>
349                         <ol>
350                                 <li><strong>Backup the database!</strong></li>
351                                 <li>Unzip the YOURLS archive</li>
352                                 <li>Upload files to your server, overwriting your existing install</li>
353                                 <li>Point your browser to <code>http://your-own-domain-here.com/admin/</code></li>
354                                 <li>Tip: you can now move your <code>config.php</code> file to the <code>/user</code> directory</li>
355                         </ol>
356                         
357                         <h2 id="upgrade13">Upgrade from YOURLS 1.3 or earlier</h2>
358                         <ol>
359                                 <li><strong>Backup the database!</strong></li>
360                                 <li>Make a copy of your <code>config.php</code></li>
361                                 <li>Delete all files including <code>.htaccess</code> in YOURLS root directory</li>
362                                 <li>Unzip the YOURLS archive, upload the files</li>
363                                 <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>
364                                 <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
365                                 <li>Point your browser to <code>http://your-own-domain-here.com/admin/</code> and follow instructions</li>
366                                 <li>After upgrade is well and over, remove the define <code>YOURLS_DB_TABLE_NEXTDEC</code> from your config file</li>
367                         </ol>
368                         
369                 </div>
370
371                 <!-- Configuration Instructions -->     
372                 <div id="ConfigDiv" style="display: none;">
373                         <h2 class='first'>Configuration (in <code>user/config.php</code>)</h2>
374                         <h3 id="mysql">MySQL settings</h3>
375                         <ul>
376                                 <li><code>YOURLS_DB_USER</code><br/>
377                                 your MySQL username<br/>
378                                 <em>Example:</em> <tt>define( 'YOURLS_DB_USER', 'joe' );</tt></li>
379                                 <li><code>YOURLS_DB_PASS</code><br/>
380                                 your MySQL password<br/>
381                                 <em>Example:</em> <tt>define( 'YOURLS_DB_PASS', 'MySeCreTPaSsW0rd' );</tt></li>
382                                 <li><code>YOURLS_DB_NAME</code>:
383                                 The database name<br/>
384                                 <em>Example:</em> <tt>define( 'YOURLS_DB_NAME', 'yourls' );</tt></li>
385                                 <li><code>YOURLS_DB_HOST</code><br/>
386                                 The database host<br/>
387                                 <em>Example:</em> <tt>define( 'YOURLS_DB_HOST', 'localhost' );</tt></li>
388                                 <li><code>YOURLS_DB_PREFIX</code><br/>
389                                 The name prefix for all the tables YOURLS will need<br/>
390                                 <em>Example:</em> <tt>define( 'YOURLS_DB_PREFIX', 'yourls_' );</tt></li>
391                         </ul>
392                         
393                         <h3 id="site">Site options</h3>
394                         <ul>
395                                 <li><code>YOURLS_SITE</code><br/>
396                                 Your (hopefully 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/>
397                                 <em>Example:</em> <tt>define( 'YOURLS_SITE', 'http://ozh.in' );</tt></li>
398                                 <li><code>YOURLS_HOURS_OFFSET</code><br/>
399                                 Timezone GMT offset<br/>
400                                 <em>Example:</em> <tt>define( 'YOURLS_HOURS_OFFSET', '-5' );</tt></li>
401                                 <li><code>YOURLS_PRIVATE</code><br/>
402                                 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/>
403                                 <em>Example:</em> <tt>define( 'YOURLS_PRIVATE', 'true' );</tt></li>
404                                 <li><code>YOURLS_UNIQUE_URLS</code><br/>
405                                 Allow multiple short URLs for a same long URL<br/>
406                                 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/>
407                                 <em>Example:</em> <tt>define( 'YOURLS_UNIQUE_URLS', 'true' );</tt></li>
408                                 <li><code>YOURLS_COOKIEKEY</code><br/>
409                                 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/>
410                                 <em>Example:</em> <tt>define( 'YOURLS_COOKIEKEY', 'qQ4KhL_pu|s@Zm7n#%:b^{A[vhm' );</tt></li>
411                                 <li><code>yourls_user_passwords</code><br/>
412                                 A list of username(s) and password(s) allowed to access the site if private<br/>
413                                 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/>
414                                 <em>Example:</em> <tt>'joe' => 'mypassword'</tt></li>
415                         </ul>
416                         
417                         <h3 id="urlsettings">URL Shortening settings</h3>
418                         <ul>
419                                 <li><code>YOURLS_URL_CONVERT</code><br/>
420                                 URL shortening method: base <tt>36</tt> or <tt>62</tt>. See <a onclick="toggle(this);" href="#FAQ">FAQ</a> for more explanations</li>
421                                 <li><code>yourls_reserved_URL</code><br/>
422                                 A list of reserved keywords that won't be used as short URLs. Define here negative, unwanted or potentially misleading keywords<br/>
423                                 <em>Example:</em> <tt>'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick'</tt></li>
424                         </ul>
425                         
426                         <h3 id="optional">Optional settings</h3>
427                         <ul>
428                                 <li><code>YOURLS_PRIVATE_INFOS</code><br/>
429                                 If <code>YOURLS_PRIVATE</code> is set to <tt>true</tt>, you can still make stat pages public. To do so, define with:<br/>
430                                 <tt>define('YOURLS_PRIVATE_INFOS', false);</tt>
431                                 </li>
432                                 <li><code>YOURLS_PRIVATE_API</code><br/>
433                                 If <code>YOURLS_PRIVATE</code> is set to <tt>true</tt>, you can still make your API public. To do so, define with:<br/>
434                                 <tt>define('YOURLS_PRIVATE_API', false);</tt>
435                                 <li><code>YOURLS_NOSTATS</code><br/>
436                                 If <code>YOURLS_NOSTATS</code> is set to <tt>true</tt>, redirects won't be logged and there will be not stats available.<br/>
437                                 </li>
438                         </ul>
439                         
440                         <h3 id="advanced">Advanced settings</h3>
441             <ul>
442                 <li>YOURLS will look for the MySQL extension PDO, MySQLi or MySQL, in that order. If you want to force usage of one particular extension, add the following line to your <code>config.php</code>:<br/>
443                 <tt>define( 'YOURLS_DB_DRIVER', 'mysqli' );</tt></li>
444                 <li>You can install YOURLS behind a firewall or a proxy: see <a href="http://yourls.org/proxy">Proxy Support</a></li>
445                 <li>File <code>includes/load-yourls.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.</li>
446             </ul>
447                 </div>
448                 
449                 <!-- YOURLS plugins -->
450                 <div id="PluginsDiv" style="display:none">
451                         <h2 class='first'>Plugins for YOURLS</h2>
452                         
453                         <h3 id="plugins">Plugins?</h3>
454                         <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>
455                         <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>
456                         <p>There's a growing number of plugins available: check the <a href="http://yourls.org/pluginlist">Plugin list</a>.</p>
457
458                         <h3 id="documentation">Documentation</h3>
459                         <p>Several sample plugins are included in the archive. Read the source and learn the concept. It's easy and fun!</p>
460                         <p>Check the <a href="http://yourls.org/pluginapi">plugin API documentation</a> to learn more</p>
461                 
462                 </div>
463                 
464                 <!-- API -->
465                 <div id="APIDiv" style="display:none">
466                         <h2 class='first'>YOURLS' API</h2>
467                         
468                         <h3 id="apifeatures">Features</h3>
469                         <ul>
470                                 <li>Generate or get existing short URLs, with sequential or custom keyword</li>
471                                 <li>Get some statistics about your links: top clicked links, least clicked links, newest links</li>
472                                 <li>Output format: JSON, XML, or simple raw text</li>
473                                 <li>Authentify either with login/password or using a secure passwordless mechanism</li>
474                         </ul>
475                         
476                         <h3 id="apiusage">Usage</h3>
477                         <p>You need to send parameters to <code>http://your-own-domain-here.com/yourls-api.php</code> either via <code>GET</code> or <code>POST</code> (remember to <strong></strong>URL encode parameters</strong> if via GET). These parameters are:</p>
478                         <ul>
479                                 <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>
480                                 <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>
481                                 <li>With <tt>action = "shorturl"</tt> :
482                                         <ul>
483                                                 <li>the <code>url</code> to shorten</li>
484                                                 <li>optional <code>keyword</code> and <code>title</code> for custom short URLs</li>
485                                                 <li>output <code>format</code>: either <tt>"jsonp"</tt>, <tt>"json"</tt>, <tt>"xml"</tt> or <tt>"simple"</tt></li>
486                                         </ul>
487                                 </li>
488                                 <li>With <tt>action = "expand"</tt> :
489                                         <ul>
490                                                 <li>the <code>shorturl</code> to expand (can be either 'abc' or 'http://site/abc')</li>
491                                                 <li>output <code>format</code>: either <tt>"jsonp"</tt>, <tt>"json"</tt>, <tt>"xml"</tt> or <tt>"simple"</tt></li>
492                                         </ul>
493                                 </li>
494                                 <li>With <tt>action = "url-stats"</tt> :
495                                         <ul>
496                                                 <li>the <code>shorturl</code> for which to get stats (can be either 'abc' or 'http://site/abc')</li>
497                                                 <li>output <code>format</code>: either <tt>"jsonp"</tt>, <tt>"json"</tt> or <tt>"xml"</tt></li>
498                                         </ul>
499                                 </li>
500                                 <li>With <tt>action = "stats"</tt> :
501                                         <ul>
502                                                 <li>the <code>filter</code>: either <tt>"top"</tt>, <tt>"bottom"</tt> , <tt>"rand"</tt> or <tt>"last"</tt></li>
503                                                 <li>the <code>limit</code> (maximum number of links to return)</li>
504                                                 <li>output <code>format</code>: either <tt>"jsonp"</tt>, <tt>"json"</tt> or <tt>"xml"</tt></li>
505                                         </ul>
506                                 </li>
507                                 <li>With <tt>action = "db-stats"</tt> :
508                                         <ul>
509                                                 <li>output <code>format</code>: either <tt>"jsonp"</tt>, <tt>"json"</tt> or <tt>"xml"</tt></li>
510                                         </ul>
511                                 </li>
512                         </ul>
513             
514             <h3 id="apiexample">Sample requests</h3>
515             <p>Example of a <tt>GET</tt> request with Javascript (using jQuery) to shorten a URL</p>
516             <pre><tt>var api_url  = 'http://sho.rt/yourls-api.php';
517 var response = $.get( api_url, {
518     username: "your_username",
519     password: "your_password",
520     action:   "shorturl",
521     format:   "json",
522     url:      "http://ozh.org/"
523     },
524     // callback function that will deal with the server response
525     function( data) {
526         // for instance, return short URL
527         return data.shorturl;
528     }
529 );</tt></pre>
530             
531             <p>Example of a <tt>POST</tt> request with PHP to expand a short URL</p>
532             <pre><tt>&lt?php
533 $username = 'your_username';
534 $password = 'your_password';
535 $api_url =  'http://sho.rt/yourls-api.php';
536
537 // Init the CURL session
538 $ch = curl_init();
539 curl_setopt($ch, CURLOPT_URL, $api_url);
540 curl_setopt($ch, CURLOPT_HEADER, 0);            // No header in the result
541 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return, do not echo result
542 curl_setopt($ch, CURLOPT_POST, 1);              // This is a POST request
543 curl_setopt($ch, CURLOPT_POSTFIELDS, array(     // Data to POST
544         'shorturl' => 'ozh',
545         'format'   => 'json',
546         'action'   => 'expand',
547         'username' => $username,
548         'password' => $password
549     ));
550
551 // Fetch and return content
552 $data = curl_exec($ch);
553 curl_close($ch);
554
555 // Do something with the result. Here, we echo the long URL
556 $data = json_decode( $data );
557 echo $data->longurl;</tt></pre>
558                         
559                         <h3 id="apireturn">Sample returns</h3>
560             <p>Sample return in JSON format for the <code>shorturl</code> action</p>
561             <pre><tt>{
562   "url": {
563     "keyword": "ozh",
564     "url": "http:\/\/ozh.org",
565     "title": "Ozh RICHARD \u00ab ozh.org",
566     "date": "2014-10-24 16:01:39",
567     "ip": "127.0.0.1"
568   },
569   "status": "success",
570   "message": "http:\/\/ozh.org added to database",
571   "title": "Ozh RICHARD \u00ab ozh.org",
572   "shorturl": "http:\/\/sho.rt\/1f",
573   "statusCode": 200
574 }</tt></pre>
575             
576             <p>Sample return in XML format for the <code>expand</code> action</p>
577                         <pre><tt>&lt;result&gt;
578     &lt;keyword&gt;ozh&lt;/keyword&gt;
579     &lt;shorturl&gt;http://sho.rt/ozh&lt;/shorturl&gt;
580     &lt;longurl&gt;http://ozh.org/&lt;/longurl&gt;
581     &lt;message&gt;success&lt;/message&gt;
582     &lt;statusCode&gt;200&lt;/statusCode&gt;
583 &lt;/result&gt;</tt></pre>
584
585                         <h3 id="apisample">Sample file</h3>
586                         <p>There's a sample PHP file included that serves as an example on how to play with the API</p>
587
588                         <h3 id="expand_api">Expand the API</h3>
589                         <p>You can easily implement custom API actions with a plugin. See the <a href="http://yourls.org/pluginlist">plugin list</a> for examples.</p>
590
591                 </div>
592                 
593
594                 <!-- FAQ Instructions -->       
595                 <div id="FAQDiv" style="display: none;">
596                         <h2 class='first'>FAQ</h2>
597
598                         <h3 id="requirement">Server requirements</h3>
599                         <ol>
600                                 <li>A server with <strong>mod_rewrite</strong> enabled</li>
601                                 <li>At least <strong>PHP 5.3</strong></li>
602                                 <li>At least <strong>MYSQL 5</strong></li>
603                                 <li><em>Note</em>: YOURLS can also run on <a href="https://github.com/YOURLS/YOURLS/wiki/Nginx-configuration">Nginx</a> and <a href="https://github.com/lylebrown/YOURLS-Cherokee">Cherokee</a></li>
604                         </ol>
605
606                         <h3 id="recommendation">Server recommendations</h3>
607                         <ul>
608                                 <li>PHP <a href="http://www.php.net/curl">CURL extension</a> installed if you plan on playing with the API</li>
609                         </ul>
610                         
611                         <h3 id="limitations">Limitations</h3>
612                         <ul>
613                                 <li>Maximum length of custom keyword is <strong>200 characters</strong></li>
614                                 <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>
615                         </ul>
616                         
617                         <h3 id="base3662">Difference Between Base 36 And Base 62 Encoding</h3>
618                         <ul>
619                                 <li>Base 36 encoding uses <code>0123456789abcdefghijklmnopqrstuvwxyz</code> for short URLs</li>
620                                 <li>Base 62 encoding uses <code>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</code></li>
621                                 <li>Stick to one setting, don't change after you've created links as it will change all your short URLs!</li>
622                                 <li>Base 36 is the default and should be picked if you're not sure.</li>
623                         </ul>
624                         
625                         <h3 id="shortdomain">Getting a short domain name for your YOURLS install</h3>
626                         <ul>
627                                 <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://yourls.org/dreamhost">Dreamhost</a> and it works just great.</li>
628                                 <li><a href="http://domai.nr/">Domainr</a> is a fun search tool that might inspire and help you</li>
629                                 <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>
630                         </ul>
631
632                         <h3 id="htaccess">YOURLS needs its own .htaccess</h3>
633                         <ul>
634                                 <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>
635                                 <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>
636                         </ul>
637                         
638                         <h3 id="does404">If YOURLS generates 404 for your short URLs</h3>
639                         <ul>
640                                 <li>Make sure <strong>mod_rewrite</strong> is enabled with your Apache server</li>
641                                 <li>Make sure your .htaccess file looks like <a href="http://yourls.org/htaccess">this one</a></li>
642                                 <li>Eventually, check your server Apache configuration allows use of .htaccess (<tt>AllowOverride All</tt> directive, ask your server admin)</li>
643                         </ul>
644                         
645                         <h3 id="sequential">Random versus sequential short URLs</h3>
646                         <ul>
647                                 <li>Out of the box, YOURLS generates sequential short URLS (ie <code>ab31</code>, then <code>ab32</code> and so on)</li>
648                                 <li>If you prefer random short URLs (ie <code>j3kz1</code> then <code>13hz7</code> like Bitly does), just activate the plugin that comes with YOURLS.</li>
649                         </ul>
650                         
651                         <h3 id="noindex">There is no index page at the root of the install</h3>
652                         <ul>
653                                 <li>Indeed. It's intended. 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>
654                                 <li>If you want to make a public interface and run your own little bitly.com, there's a sample file provided as an example: <code>sample-public-front-page.txt</code>. This implies important issues to deal with: spam, performance and security. Read <a href="http://yourls.org/public">Public Shortening</a> for important information.</li>
655                         </ul>
656                         
657                         <h3 id="lowercase">Uppercase letters in short URLs are eaten up, eg "<code>OmgOzh</code>" becomes "<code>mgzh</code>" !</h3>
658                         <ul>
659                                 <li>Indeed. It's intented if you selected Base 36 (see above). Letters that don't belong to the character set, eg <code>@#!</code> or <code>ABC</code>, are removed.</li>
660                                 <li>If you want to force lowercase, you'll need a <a href="http://yourls.org/pluginlist">plugin</a>.</li>
661                         </ul>
662                         
663                         <h3 id="feedback">Feedback, feature requests and bug reporting</h3>
664                         <ol>
665                                 <li>Please don't get in touch directly by mail or Twitter. <a href="http://yourls.org/support">Please</a>.</li>
666                                 <li>Check the <a href="http://yourls.org/roadmap">Road Map</a> for future features.</li>
667                                 <li>Read all the <a href="http://yourls.org/wiki">wiki documents</a>.</li>
668                                 <li>Search in all the <a href="http://yourls.org/issues">issues</a>, open and closed.</li>
669                                 <li>Eventually raise a new issue. To do so, please read the <a href="http://yourls.org/contribute">contribute guidelines</a>. Thanks!</li>
670                         </ol>
671
672                 </div>
673                 
674                 
675                 <!-- More -->   
676                 <div id="MoreDiv" style="display: none;">
677                 
678                         <h2 class='first'>Community</h2>
679                         
680                         <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>
681                         
682                         <h3 id="ressources">Resources</h3>
683                         <ul>
684                                 <li>The official <a href="http://blog.yourls.org">YOURLS blog</a>, for news, hints and showcase.</li>
685                                 <li>The <a href="http://yourls.org/wiki">wiki</a>: advanced documentation, plugins, tips and more</li>
686                                 <li>Follow <a href="https://twitter.com/YOURLS">@YOURLS</a> for hardcore development, and <a href="https://twitter.com/ozh">@Ozh</a> for tips and news (and random geekiness too)</li>
687                         </ul>
688                 
689                         <h2 id="showcase">Showcase</h2>
690
691                         <h3>Here are a few examples of sites running YOURLS with a unique design or concept</h3>
692                         <ul>
693                                 <li><a href="http://oe.cd/">http://oe.cd/</a><br/>
694                                 OECD's internal URL shortener with a neat interface and private features</li>
695                                 
696                                 <li><a href="http://yourwish.es/">http://yourwish.es/</a><br/>
697                                 Easily share an Amazon wishlist</li>
698                                 
699                                 <li><a href="http://vbly.us">http://vbly.us</a><br/>
700                                 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>
701                         </ul>
702                         
703                         <h2 id="frameworks">YOURLS and other platforms or frameworks</h2>
704                         <ul>            
705                                 <li id="wordpress"><a href="http://wordpress.org/extend/plugins/search.php?q=yourls">WordPress</a><br/>
706                                 There are numerous WordPress plugin with YOURLS support. <a href="http://wordpress.org/extend/plugins/yourls-link-creator/">YOURLS Link Creator</a> is recommended.</li>
707                                 
708                                 <li id="drupal"><a href="http://drupal.org/project/yourls">Drupal</a><br/>
709                                 Allows for the automatic creation of short urls using a YOURLS installation</li>
710                                 
711                                 <li id="perl"><a href="http://github.com/pjain/WWW-Shorten-Yourls">Perl</a><br/>
712                                 WWW-Shorten-Yourls is a Perl module to shorten URLs using YOURLS</li>
713                                 
714                                 <li id="ruby"><a href="https://github.com/threestage/yourls">Ruby</a><br/>
715                                 A Ruby wrapper for the YOURLS API</li>
716                                 
717                                 <li id="python"><a href="http://tflink.github.com/python-yourls/">Python</a><br/>
718                                 A Python client for YOURLS</li>
719                                 
720                                 <li id="vbnet"><a href="http://www.nugardt.com/open-source/yourls-api/">VB .Net</a><br/>
721                                 A VB .Net 4.0 wrapper for the YOURLS API</li>
722                                 
723                                 <li id="javascript"><a href="http://neocotic.com/yourls-api/">Javascript</a><br/>
724                                 JavaScript bindings for the YOURLS API to leverage JSONP support</li>
725
726                                 <li id="cake"><a href="https://github.com/driflash/CakePHP-YOURLS-Plugin">CakePHP</a><br/>
727                                 Plugin which integrates CakePHP with Yourls</li>
728                                 
729                                 <li id="statusnet"><a href="https://github.com/rthees/yourls-status-net">status.net</a><br/>
730                                 A plugin for status.net to use YOURLS</li>
731                                 
732                                 <li id="sharetronix"><a href="http://developer.sharetronix.com/mpview/12/tag:yourls">Sharetronix</a><br/>
733                                 A YOURLS addon for Sharetronix</li>
734                                 
735                         </ul>
736                                 
737                         <h2>YOURLS works with your favorite sofware or device</h2>
738                         <ul>
739                                 <li id="tweetie2"><a href="http://www.eugenegordin.com/etc/how-to-use-your-custom-yourls-shortener-with-tweetie-2.html">Tweetie 2</a><br/>
740                                 How to set up Tweetie2 so it uses your own service</li>
741                                 
742                                 <li id="tweetbot"><a href="http://2fatdads.com/2012/02/how-to-make-yourls-org-work-in-tweetbot/">Tweetbot</a><br/>
743                                 Make Tweetbot run with YOURLS</li>
744                                 
745                                 <li id="twitterfeed"><a href="http://blog.yourls.org/2011/09/how-to-use-twitterfeed-with-your-custom-yourls-url-shortener/">Twitterfeed</a><br/>
746                                 Use Twitterfeed with YOURLS</li>
747
748                                 <li id="mac"><a href="http://timi.im/app/">Mac Client</a><br/>
749                                 Simple app to have a global keyboard shortcut send a link to YOURLS</li>
750
751                                 <li id="android">Android: <a href="https://play.google.com/store/apps/details?id=de.mateware.ayourls">aYourls</a>, <a href="https://play.google.com/store/apps/details?id=com.mndroid.apps.urly">URLy</a> and <a href="https://play.google.com/store/apps/details?id=de.keineantwort.android.urlshortener">URL Shortener</a><br/>
752                                 Android apps that plays nice with YOURLS</li>
753
754                                 <li id="iphone">iOS: <a href="http://adamdehaven.com/blog/2015/05/shorttail-for-yourls-an-elegant-yourls-client-for-iphone/">ShortTail for YOURLS</a>, <a href="http://itunes.apple.com/us/app/clicklytics-track-clicks-on/id444008024?mt=8">Clicklytics</a> and <a href="https://itunes.apple.com/us/app/myyourls/id661934890?mt=8">myYOURLS</a><br/>
755                                 Apps to use YOURLS on iPhones and iPads</li>
756
757                                 <li id="chrome"><a href="https://github.com/ukoms/Chrourls">Chrourls</a><br/>
758                                 Google Chrome quick link shortening addon for YOURLS</li>
759
760                                 <li id="firefox"><a href="https://addons.mozilla.org/en-us/firefox/addon/yourls-shortener/">Firefox Addon</a><br/>
761                                 Firefox Addon for YOURLS</li>
762
763                                 <li id="textexpander"><a href="http://www.chrismarquardt.com/blog.php?id=7952283233607249761">Textexpander and YOURLS</a><br/>
764                                 Making YOURLS and Textexpander on the Mac play together</li>
765                         </ul>
766
767                         <h2 id="morestuff">More stuff to do with YOURLS</h2>
768                         <ul>
769                                 
770                                 <li><a href="https://github.com/tomslominski/infinity-squared">Infinity Squared</a><br/>
771                                 &#8734;&sup2; is a public page theme for YOURLS to help you design your own public interface</li>
772                                 
773                                 <li><a href="https://github.com/Flynntes/Sleeky">Sleeky</a><br/>
774                                 Sleeky is another public page theme for YOURLS</li>
775                                 
776                                 <li><a href="https://github.com/ScottHelme/yourls-index-page">Scott Helme's page</a><br/>
777                                 Example index page listing all the URLs held in a YOURLS database</li>
778                                 
779                                 <li><a href="http://screenr.com/nTs">http://screenr.com/nTs</a><br/>
780                                 A screencast explaining how to setup YOURLS</li>
781                                 
782                                 <li><a href="http://v007.me/836">YOURLS: Short URL Widget</a><br/>
783                                 Creates a fully configurable widget that outputs the short URL to the current post or page</li>
784                                 
785                                 <li><a href="http://foolrulez.org/blog/2009/09/yourls-widget-released">YOURLS Widget for WordPress</a><br/>
786                                 This widget adds a convenient short URL service into your sidebar. Check the above link for a live example</li>
787                                 
788                                 <li><a href="http://www.stewartallen.org/2010/08/yourls-twitter-tools-wordpress-plugin/">Twitter Tools & YOURLS</a><br/>
789                                 Companion plugin for Alex King's Twitter Tool for WordPress, that enables YOURLS support</li>
790                                 
791                                 <li><a href="http://code.google.com/p/yourls/issues/detail?id=137">Export URLS as text list</a><br/>
792                                 A simple script to list all URLs, one per line, in plain text (for using as an indexer config file, for example)</li>
793                                 
794                                 <li>YOURLS featured on <a href="http://lifehacker.com/5335216/make-your-own-url-shortening-service">Lifehacker</a></li>
795                         </ul>
796
797                         <h2>"Celebrity endorsements", sort of.</h2>
798                         <ul>
799                                 
800                                 <li><a href="http://smashed.by/">http://smashed.by/</a> by <a href="http://smashingmagazine.com/">Smashing Magazine</a></li>
801                 
802                                 <li><a href="http://oe.cd/">http://oe.cd/</a> by <a href="http://www.oecd.org/">the OECD</a></li>
803
804                                 <li><a href="http://cuny.is/">http://cuny.is/</a> by <a href="http://www.cuny.edu/">the City University of New York</a></li>
805
806                                 <li><a href="http://virg.in/">http://virg.in/</a> for the <a href="http://www.virgin.com/">Virgin Group companies</a></li>
807                 
808                                 <li><a href="http://dhurl.org/">http://dhurl.org/</a> by <a href="http://yourls.org/dreamhost">Dreamhost</a></li>
809
810                                 <li><a href="https://rho.st/">https://rho.st/</a> by <a href="https://www.rosehosting.com/">RoseHosting.com</a></li>
811                                 
812                         </ul>
813                                 
814                                 
815                 </div>
816         </div> <!-- content -->
817         </main>
818 </div> <!-- container -->
819
820 <div id="fade"></div>
821
822         <script type="text/javascript">
823         /* <![CDATA[*/
824         // Dynamically get tabs
825         function getTabs() {
826                 var d = document.getElementById('Tabs');
827                 var matches = d.innerHTML.match(/<li.* id="(.+?)Tab"/g);
828                 var tabs = []
829                 for (i in matches) {
830                   tabs[i]= matches[i].replace(/<li.* id="/,'').replace('Tab"', '');
831                 }
832                 tabs = tabs.reverse();
833                 return (tabs)
834         }
835         // Scroll to ?anchor
836         // window.location.hash
837         
838         // Toggle tab display
839         function toggle(el) {
840                 var hashes = el.toString().replace(/^.*?#/, '').split('#');
841                 var target = hashes[0];
842                 var anchor = hashes[1];
843                 // If tab doesn't exist, exit
844                 if( tabs.indexOf( target ) == -1 )
845                         return;
846                 for (var tab in tabs) {
847                         // reinit tabs
848                         document.getElementById(tabs[tab]+'Tab').className = 'Tab';
849                         // reinit divs
850                         document.getElementById(tabs[tab]+'Div').style.display= 'none';
851                 }
852                 // highlight & display target
853                 document.getElementById(target+'Div').style.display = 'block';
854                 document.getElementById(target+'Tab').className = 'SelectedTab';
855                 randbg();
856                 try { el.blur(); } catch(err) {}
857                 // Try scrolling to anchor
858                 try {
859                         window.scroll(0,findPos(document.getElementById(anchor)));
860                 } catch(err) { window.location.hash = target; }
861         }
862         // Get tab list
863         var tabs = getTabs();
864         // On page load/refresh display required tab
865         if (location.hash) {
866                 toggle(location.hash);
867         }
868         // Background fancyness
869         function randbg(){
870                 var rndbg = [ 'bg_ants.png', 'bg_circles.png', 'bg_cross.png', 'bg_diag.png', 'bg_fuzzy.png', 'bg_fuzzy_bits.png', 'bg_yourls.png', 'bg_fuzzy_bits.png', 'bg_life.png', 'bg_boobs.png' ];
871                 var bg = rndbg[ Math.floor( Math.random() * rndbg.length ) ];
872                 document.body.style.background='#E3F3FF url(user/plugins/random-bg/img/'+bg+')';
873         };
874         randbg();
875         //Finds y value of given object
876         function findPos(obj) {
877                 var curtop = 0;
878                 if (obj.offsetParent) {
879                         do {
880                                 curtop += obj.offsetTop;
881                         } while (obj = obj.offsetParent);
882                 curtop = curtop - 30;
883                 return [curtop];
884                 }
885         }
886         /* ]]> */
887         </script>
888
889
890 </body>
891 </html>