Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-05 Thread Mingli Yuan
Thanks Liangent and Sadik.

Since this list is not the place to discuss bugs, please send your findings
at below link

http://github.com/mountain/shortify/issues

Thanks very much.

On Thu, Aug 5, 2010 at 1:57 PM, Mingli Yuan  wrote:

> Now a test server was setup and 5 languages are supported
>
> * http://ultrafilter.org:8080/s/cs
> * http://ultrafilter.org:8080/s/en
> * http://ultrafilter.org:8080/s/he
> * http://ultrafilter.org:8080/s/ml
> * http://ultrafilter.org:8080/s/zh
>
> Thanks for people's contribution to localize this small software:
>
> * mountain: Chinese language
> * svick: Czech language
> * mountain and Casey: English language
> * amire80: Hebrew language
> * Sadik Khalid: Malayalam language
>
>
> If you want to localize more language, please take a look of the file
>
> http://github.com/mountain/shortify/blob/master/config/i18n.js
>
>
> Clone and patch to me on github, or send me the patch directly via mail.
> http://github.com/mountain/shortify
>
> Thanks.
>
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-04 Thread Liangent
On 8/5/10, Mingli Yuan  wrote:
> Now a test server was setup and 5 languages are supported

Special characters are not escaped. Try "&" in the box.

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-04 Thread സാദിക്ക് ഖാലിദ് Sadik Khali d
On Thu, Aug 5, 2010 at 8:57 AM, Mingli Yuan  wrote:

> Now a test server was setup and 5 languages are supported
>
> * http://ultrafilter.org:8080/s/cs
>
There is '&n' at top left corner of the screen


> * http://ultrafilter.org:8080/s/en
>
Working

* http://ultrafilter.org:8080/s/he
>
Working

* http://ultrafilter.org:8080/s/ml
>
Not working


> * http://ultrafilter.org:8080/s/zh
>
There is '&nbs' at top left corner of the screen

-- 
സ്‌നേഹാന്വേഷണങ്ങളോടെ,
സാദിക്ക് ഖാലിദ്
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-04 Thread Mingli Yuan
Now a test server was setup and 5 languages are supported

* http://ultrafilter.org:8080/s/cs
* http://ultrafilter.org:8080/s/en
* http://ultrafilter.org:8080/s/he
* http://ultrafilter.org:8080/s/ml
* http://ultrafilter.org:8080/s/zh

Thanks for people's contribution to localize this small software:

* mountain: Chinese language
* svick: Czech language
* mountain and Casey: English language
* amire80: Hebrew language
* Sadik Khalid: Malayalam language


If you want to localize more language, please take a look of the file

http://github.com/mountain/shortify/blob/master/config/i18n.js


Clone and patch to me on github, or send me the patch directly via mail.
http://github.com/mountain/shortify

Thanks.
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-03 Thread MZMcBride
Mingli Yuan wrote:
> Thanks for you response. How dose admin actions mess up pageid?
> Could you give me some example, so I would try to find a way to avoid it.

If an admin deletes and then undeletes a page, the old page ID is not retained.

MZMcBride


___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-03 Thread Liangent
On 8/4/10, Mingli Yuan  wrote:
> Thanks for you response. How dose admin actions mess up pageid?
> Could you give me some example, so I would try to find a way to avoid it.

Deletions and restorations. They're often used to deal with mixed
history (eg. results of c&p move).

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-03 Thread Mingli Yuan
> Why would you reduce the page ID in length with base 36? They're, what, 10
digits?
> Roan Kattouw (Catrope)

Hi, Roan, base 36 encoding/decoding is very cheap in Javascript, just call

* parseInt(string, radix)
* number.toString(radix)

Where radix is range from 2 to 36.
You know, combining 0~9 and a ~z, we get 36 letters.

> you should consider base32
> j

base 36 is more compact than base 32.

> URL has Read-Only access
> Sadik Khalid

Hi, Sadik,

I use github to manage the versions of my code.
You can send me the code directly via mail, and I will merge it to the code.
Thanks.

> Some admin actions mess up pageid (and I did some from time to time),
> so your idea that a page id identifies a title is buggy.
> Liangent

Hi, Liangent,

Thanks for you response. How dose admin actions mess up pageid?
Could you give me some example, so I would try to find a way to avoid it.


On Tue, Aug 3, 2010 at 11:59 PM, Mingli Yuan  wrote:

> Hi, folks,
>
> For many languages which dose not use Latin characters, the URL of an
> articles in Wikipedia might be very long.
> This is the case for Chinese Wikipedia.
>
> So in order to help people on this problem, I create a small project to
> solve it, and it runs successfully on my local machine.
> Although I dose not deploy it to a public server yet, I decided to make the
> code public first.
> You can get the code at http://github.com/mountain/shortify
>
> It uses API call to get pageId by the title, and then convert pageId by
> base 36 to the short url. It is quite simple.
> To reduce the frequency of API call, a simple cache was used.  So far, only
> Chinese and English were supported.
>
> If you think your language need such kind a tool, please help me localize
> the i18n config file at
> http://github.com/mountain/shortify/blob/master/config/i18n.js
>
> Comments are welcomed. If you can help setup a server, that would be nice
> and please contact me separately.
>
> Regards,
>
> Mingli (User:Mountain)
>
>
>
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-03 Thread Liangent
Some admin actions mess up pageid (and I did some from time to time),
so your idea that a page id identifies a title is buggy.

On 8/4/10, സാദിക്ക് ഖാലിദ് Sadik Khalid  wrote:
>> If you think your language need such kind a tool, please help me localize
>> the i18n config file at
>> http://github.com/mountain/shortify/blob/master/config/i18n.js
>>
>
> URL has Read-Only access
>
>
> On Tue, Aug 3, 2010 at 7:09 PM,  wrote:
>
>> On 08/03/2010 05:59 PM, Mingli Yuan wrote:
>> > It uses API call to get pageId by the title, and then convert pageId by
>> base
>> > 36 to the short url. It is quite simple.
>> > To reduce the frequency of API call, a simple cache was used.  So far,
>> only
>> > Chinese and English were supported.
>>
>> you should consider base32
>> http://www.crockford.com/wrmg/base32.html
>>
>> j
>>
>> ___
>> Wikitech-l mailing list
>> Wikitech-l@lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
>
>
>
> --
> സ്‌നേഹാന്വേഷണങ്ങളോടെ,
> സാദിക്ക് ഖാലിദ്
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-03 Thread സാദിക്ക് ഖാലിദ് Sadik Khali d
> If you think your language need such kind a tool, please help me localize
> the i18n config file at
> http://github.com/mountain/shortify/blob/master/config/i18n.js
>

URL has Read-Only access


On Tue, Aug 3, 2010 at 7:09 PM,  wrote:

> On 08/03/2010 05:59 PM, Mingli Yuan wrote:
> > It uses API call to get pageId by the title, and then convert pageId by
> base
> > 36 to the short url. It is quite simple.
> > To reduce the frequency of API call, a simple cache was used.  So far,
> only
> > Chinese and English were supported.
>
> you should consider base32
> http://www.crockford.com/wrmg/base32.html
>
> j
>
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>



-- 
സ്‌നേഹാന്വേഷണങ്ങളോടെ,
സാദിക്ക് ഖാലിദ്
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-03 Thread j
On 08/03/2010 05:59 PM, Mingli Yuan wrote:
> It uses API call to get pageId by the title, and then convert pageId by base
> 36 to the short url. It is quite simple.
> To reduce the frequency of API call, a simple cache was used.  So far, only
> Chinese and English were supported.

you should consider base32
http://www.crockford.com/wrmg/base32.html

j

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-03 Thread Roan Kattouw
2010/8/3 Mingli Yuan :
> It uses API call to get pageId by the title, and then convert pageId by base
> 36 to the short url. It is quite simple.
> To reduce the frequency of API call, a simple cache was used.  So far, only
> Chinese and English were supported.
>
Why would you reduce the page ID in length with base 36? They're,
what, 10 digits?

Roan Kattouw (Catrope)

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[Wikitech-l] A Shorturl Service for Wikipedia Projects by Node.js

2010-08-03 Thread Mingli Yuan
Hi, folks,

For many languages which dose not use Latin characters, the URL of an
articles in Wikipedia might be very long.
This is the case for Chinese Wikipedia.

So in order to help people on this problem, I create a small project to
solve it, and it runs successfully on my local machine.
Although I dose not deploy it to a public server yet, I decided to make the
code public first.
You can get the code at http://github.com/mountain/shortify

It uses API call to get pageId by the title, and then convert pageId by base
36 to the short url. It is quite simple.
To reduce the frequency of API call, a simple cache was used.  So far, only
Chinese and English were supported.

If you think your language need such kind a tool, please help me localize
the i18n config file at
http://github.com/mountain/shortify/blob/master/config/i18n.js

Comments are welcomed. If you can help setup a server, that would be nice
and please contact me separately.

Regards,

Mingli (User:Mountain)
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l