Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated README

  • Loading branch information...
commit 7918dd36d7b4e3b1381112e9922dff495df9d08a 1 parent e4a8b2d
@gabrielpreston authored
Showing with 43 additions and 29 deletions.
  1. +0 −29 README
  2. +43 −0 README.md
View
29 README
@@ -1,29 +0,0 @@
-Example script:
- var Yourls = require('./node-yourls/yourls');
-
- var yourls_url = 'ph.ly';
- var yourls_api = '1a40d1e654';
-
- var yourls = new Yourls(yourls_url, yourls_api);
-
- yourls.shorten('https://github.com/gabrielpreston/node-yourls', function(error, result) {
- if (error) {
- throw error;
- }
- console.log(result);
- });
-
-Output:
- { status: 'fail',
- code: 'error:url',
- url:
- { keyword: '',
- url: 'https://github.com/gabrielpreston/node-yourls',
- title: 'gabrielpreston/node-yourls · GitHub',
- date: '2012-04-18 15:00:56',
- ip: '204.236.242.146',
- clicks: '0' },
- message: 'https://github.com/gabrielpreston/node-yourls already exists in database',
- title: 'gabrielpreston/node-yourls · GitHub',
- shorturl: 'http://ph.ly/dzg-v',
- statusCode: 200 }
View
43 README.md
@@ -0,0 +1,43 @@
+node-yourls - Yourls API for nodejs
+====================
+
+This module provides hooks into the [Yourls](http://yourls.org/) API for [Nodejs](http://nodejs.org).
+For more information about Yourls and what it can do, visit their [API docs](http://yourls.org/#API).
+
+Note
+----
+YOURLS is a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL). You can make it private or public, you can pick custom keyword URLs. This means you will need the URL of yours, or someone else's YOURLS installation as well as an API Signature token from their setup.
+
+Installation
+------------
+This module has not been added to NPM yet. Eventually you will be able to do `npm install yourls`.
+
+Until then, install via git by cloning: `git clone https://github.com/gabrielpreston/node-yourls.git /path/to/yourls`
+
+Usage
+-----
+ var Yourls = require('./node-yourls/yourls');
+
+ var yourls_url = 'ph.ly';
+ var yourls_api = '1a40d1e654';
+
+ var yourls = new Yourls(yourls_url, yourls_api);
+
+ yourls.shorten('https://github.com/gabrielpreston/node-yourls', function(error, result) {
+ if (error) {
+ throw error;
+ }
+ console.log(result);
+ });
+
+
+Tests
+-----
+To run tests type `npm test`
+
+Yourls Features
+---------------
+* shorten
+* vanity
+* expand
+* urlstats
Please sign in to comment.
Something went wrong with that request. Please try again.