---------- Forwarded message ----------
From: vaisna rajan <pbvaisna@gmail.com>
Date: Mon, Mar 5, 2012 at 11:19 PM
Subject: request
To: webp2p@librelist.com
hi,i am a student.my project slightly based on ur dirty share. it is nice.
how will generate random url for every link. can anyone help me? please...
with regards,vaisna.
Not quite sure what you mean, this is how it does it now:
20 app.get('/', function (req, res) {
21 res.redirect('/' + randomString());
22 });
[...]
98 // Utilities
99 function randomString() {
100 var chars =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz";
101 var string_length = 8;
102 var randomstring = '';
103 for (var i=0; i<string_length; i++) {
104 var rnum = Math.floor(Math.random() * chars.length);
105 randomstring += chars.substring(rnum,rnum+1);
106 }
107 return randomstring;
108 }
R
On Mon, Mar 5, 2012 at 10:09 AM, vaisna rajan <pbvaisna@gmail.com> wrote:
>
>
> ---------- Forwarded message ----------
> From: vaisna rajan <pbvaisna@gmail.com>
> Date: Mon, Mar 5, 2012 at 11:19 PM
> Subject: request
> To: webp2p@librelist.com
>
>
> hi,i am a student.my project slightly based on ur dirty share. it is nice.
> how will generate random url for every link. can anyone help me? please...
>
>
>
>
> with regards,vaisna.
>
>
--
Rich Jones
Director, Gun.io
ya.it's right. if we open that page, it automatically generate the html index as the name of random number.is that any php file involve in this?.. i downloaded the source but i cannot got the same work as your website works.. can i know the reason for that? On Mon, Mar 5, 2012 at 11:43 PM, Rich Jones <rich@gun.io> wrote: > Not quite sure what you mean, this is how it does it now: > > 20 app.get('/', function (req, res) { > 21 res.redirect('/' + randomString()); > 22 }); > > [...] > > 98 // Utilities > 99 function randomString() { > 100 var chars = > "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz"; > 101 var string_length = 8; > 102 var randomstring = ''; > 103 for (var i=0; i<string_length; i++) { > 104 var rnum = Math.floor(Math.random() * chars.length); > 105 randomstring += chars.substring(rnum,rnum+1); > 106 } > 107 return randomstring; > 108 } > > R > > On Mon, Mar 5, 2012 at 10:09 AM, vaisna rajan <pbvaisna@gmail.com> wrote: > >> >> >> ---------- Forwarded message ---------- >> From: vaisna rajan <pbvaisna@gmail.com> >> Date: Mon, Mar 5, 2012 at 11:19 PM >> Subject: request >> To: webp2p@librelist.com >> >> >> hi,i am a student.my project slightly based on ur dirty share. it is >> nice. how will generate random url for every link. can anyone help me? >> please... >> >> >> >> >> with regards,vaisna. >> >> > > > -- > Rich Jones > Director, Gun.io > >
This is not written in PHP, this is written in Node.js with Socket.io. The server software is in javascript, as well as the client side code in the browser. R On Mon, Mar 5, 2012 at 10:23 AM, vaisna rajan <pbvaisna@gmail.com> wrote: > ya.it's right. if we open that page, it automatically generate the html > index as the name of random number.is that any php file involve in > this?.. i downloaded the source but i cannot got the same work as your > website works.. can i know the reason for that? > > > On Mon, Mar 5, 2012 at 11:43 PM, Rich Jones <rich@gun.io> wrote: > >> Not quite sure what you mean, this is how it does it now: >> >> 20 app.get('/', function (req, res) { >> 21 res.redirect('/' + randomString()); >> 22 }); >> >> [...] >> >> 98 // Utilities >> 99 function randomString() { >> 100 var chars = >> "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz"; >> 101 var string_length = 8; >> 102 var randomstring = ''; >> 103 for (var i=0; i<string_length; i++) { >> 104 var rnum = Math.floor(Math.random() * chars.length); >> 105 randomstring += chars.substring(rnum,rnum+1); >> 106 } >> 107 return randomstring; >> 108 } >> >> R >> >> On Mon, Mar 5, 2012 at 10:09 AM, vaisna rajan <pbvaisna@gmail.com> wrote: >> >>> >>> >>> ---------- Forwarded message ---------- >>> From: vaisna rajan <pbvaisna@gmail.com> >>> Date: Mon, Mar 5, 2012 at 11:19 PM >>> Subject: request >>> To: webp2p@librelist.com >>> >>> >>> hi,i am a student.my project slightly based on ur dirty share. it is >>> nice. how will generate random url for every link. can anyone help me? >>> please... >>> >>> >>> >>> >>> with regards,vaisna. >>> >>> >> >> >> -- >> Rich Jones >> Director, Gun.io >> >> > -- Rich Jones Director, Gun.io
i got code from github.com. then i will click on index,html..... the random url cannot be generated. please explain me. how can i make it as run? On Mon, Mar 5, 2012 at 11:58 PM, Rich Jones <rich@gun.io> wrote: > This is not written in PHP, this is written in Node.js with Socket.io. The > server software is in javascript, as well as the client side code in the > browser. > > R > > > On Mon, Mar 5, 2012 at 10:23 AM, vaisna rajan <pbvaisna@gmail.com> wrote: > >> ya.it's right. if we open that page, it automatically generate the html >> index as the name of random number.is that any php file involve in >> this?.. i downloaded the source but i cannot got the same work as your >> website works.. can i know the reason for that? >> >> >> On Mon, Mar 5, 2012 at 11:43 PM, Rich Jones <rich@gun.io> wrote: >> >>> Not quite sure what you mean, this is how it does it now: >>> >>> 20 app.get('/', function (req, res) { >>> 21 res.redirect('/' + randomString()); >>> 22 }); >>> >>> [...] >>> >>> 98 // Utilities >>> 99 function randomString() { >>> 100 var chars = >>> "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz"; >>> 101 var string_length = 8; >>> 102 var randomstring = ''; >>> 103 for (var i=0; i<string_length; i++) { >>> 104 var rnum = Math.floor(Math.random() * chars.length); >>> 105 randomstring += chars.substring(rnum,rnum+1); >>> 106 } >>> 107 return randomstring; >>> 108 } >>> >>> R >>> >>> On Mon, Mar 5, 2012 at 10:09 AM, vaisna rajan <pbvaisna@gmail.com>wrote: >>> >>>> >>>> >>>> ---------- Forwarded message ---------- >>>> From: vaisna rajan <pbvaisna@gmail.com> >>>> Date: Mon, Mar 5, 2012 at 11:19 PM >>>> Subject: request >>>> To: webp2p@librelist.com >>>> >>>> >>>> hi,i am a student.my project slightly based on ur dirty share. it is >>>> nice. how will generate random url for every link. can anyone help me? >>>> please... >>>> >>>> >>>> >>>> >>>> with regards,vaisna. >>>> >>>> >>> >>> >>> -- >>> Rich Jones >>> Director, Gun.io >>> >>> >> > > > -- > Rich Jones > Director, Gun.io > >
You must installed Node and socket.io (using NPM), then, to run the server, run 'node server.js' You should read a lot about Node.js and Socket.io before you go any further though, otherwise you will be overwhelmed. R On Mon, Mar 5, 2012 at 10:33 AM, vaisna rajan <pbvaisna@gmail.com> wrote: > i got code from github.com. then i will click on index,html..... the > random url cannot be generated. > please explain me. how can i make it as run? > > > On Mon, Mar 5, 2012 at 11:58 PM, Rich Jones <rich@gun.io> wrote: > >> This is not written in PHP, this is written in Node.js with Socket.io. >> The server software is in javascript, as well as the client side code in >> the browser. >> >> R >> >> >> On Mon, Mar 5, 2012 at 10:23 AM, vaisna rajan <pbvaisna@gmail.com> wrote: >> >>> ya.it's right. if we open that page, it automatically generate the html >>> index as the name of random number.is that any php file involve in >>> this?.. i downloaded the source but i cannot got the same work as your >>> website works.. can i know the reason for that? >>> >>> >>> On Mon, Mar 5, 2012 at 11:43 PM, Rich Jones <rich@gun.io> wrote: >>> >>>> Not quite sure what you mean, this is how it does it now: >>>> >>>> 20 app.get('/', function (req, res) { >>>> 21 res.redirect('/' + randomString()); >>>> 22 }); >>>> >>>> [...] >>>> >>>> 98 // Utilities >>>> 99 function randomString() { >>>> 100 var chars = >>>> "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz"; >>>> 101 var string_length = 8; >>>> 102 var randomstring = ''; >>>> 103 for (var i=0; i<string_length; i++) { >>>> 104 var rnum = Math.floor(Math.random() * chars.length); >>>> 105 randomstring += chars.substring(rnum,rnum+1); >>>> 106 } >>>> 107 return randomstring; >>>> 108 } >>>> >>>> R >>>> >>>> On Mon, Mar 5, 2012 at 10:09 AM, vaisna rajan <pbvaisna@gmail.com>wrote: >>>> >>>>> >>>>> >>>>> ---------- Forwarded message ---------- >>>>> From: vaisna rajan <pbvaisna@gmail.com> >>>>> Date: Mon, Mar 5, 2012 at 11:19 PM >>>>> Subject: request >>>>> To: webp2p@librelist.com >>>>> >>>>> >>>>> hi,i am a student.my project slightly based on ur dirty share. it is >>>>> nice. how will generate random url for every link. can anyone help me? >>>>> please... >>>>> >>>>> >>>>> >>>>> >>>>> with regards,vaisna. >>>>> >>>>> >>>> >>>> >>>> -- >>>> Rich Jones >>>> Director, Gun.io >>>> >>>> >>> >> >> >> -- >> Rich Jones >> Director, Gun.io >> >> > -- Rich Jones Director, Gun.io
k. let us try.. and reply u soon. thank u for kindly help. On Tue, Mar 6, 2012 at 12:13 AM, Rich Jones <rich@gun.io> wrote: > You must installed Node and socket.io (using NPM), then, to run the > server, run > > 'node server.js' > > You should read a lot about Node.js and Socket.io before you go any > further though, otherwise you will be overwhelmed. > > R > > > On Mon, Mar 5, 2012 at 10:33 AM, vaisna rajan <pbvaisna@gmail.com> wrote: > >> i got code from github.com. then i will click on index,html..... the >> random url cannot be generated. >> please explain me. how can i make it as run? >> >> >> On Mon, Mar 5, 2012 at 11:58 PM, Rich Jones <rich@gun.io> wrote: >> >>> This is not written in PHP, this is written in Node.js with Socket.io. >>> The server software is in javascript, as well as the client side code in >>> the browser. >>> >>> R >>> >>> >>> On Mon, Mar 5, 2012 at 10:23 AM, vaisna rajan <pbvaisna@gmail.com>wrote: >>> >>>> ya.it's right. if we open that page, it automatically generate the >>>> html index as the name of random number.is that any php file involve >>>> in this?.. i downloaded the source but i cannot got the same work as your >>>> website works.. can i know the reason for that? >>>> >>>> >>>> On Mon, Mar 5, 2012 at 11:43 PM, Rich Jones <rich@gun.io> wrote: >>>> >>>>> Not quite sure what you mean, this is how it does it now: >>>>> >>>>> 20 app.get('/', function (req, res) { >>>>> 21 res.redirect('/' + randomString()); >>>>> 22 }); >>>>> >>>>> [...] >>>>> >>>>> 98 // Utilities >>>>> 99 function randomString() { >>>>> 100 var chars = >>>>> "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz"; >>>>> 101 var string_length = 8; >>>>> 102 var randomstring = ''; >>>>> 103 for (var i=0; i<string_length; i++) { >>>>> 104 var rnum = Math.floor(Math.random() * chars.length); >>>>> 105 randomstring += chars.substring(rnum,rnum+1); >>>>> 106 } >>>>> 107 return randomstring; >>>>> 108 } >>>>> >>>>> R >>>>> >>>>> On Mon, Mar 5, 2012 at 10:09 AM, vaisna rajan <pbvaisna@gmail.com>wrote: >>>>> >>>>>> >>>>>> >>>>>> ---------- Forwarded message ---------- >>>>>> From: vaisna rajan <pbvaisna@gmail.com> >>>>>> Date: Mon, Mar 5, 2012 at 11:19 PM >>>>>> Subject: request >>>>>> To: webp2p@librelist.com >>>>>> >>>>>> >>>>>> hi,i am a student.my project slightly based on ur dirty share. it is >>>>>> nice. how will generate random url for every link. can anyone help me? >>>>>> please... >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> with regards,vaisna. >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Rich Jones >>>>> Director, Gun.io >>>>> >>>>> >>>> >>> >>> >>> -- >>> Rich Jones >>> Director, Gun.io >>> >>> >> > > > -- > Rich Jones > Director, Gun.io > >