Re: [Wikitech-l] About page ID

2012-02-21 Thread Brion Vibber
On Sun, Feb 19, 2012 at 5:49 AM, Sumana Harihareswara suma...@wikimedia.org
 wrote:

 On 02/19/2012 01:10 AM, John Erling Blad wrote:
  Some of the urls to Wikipedia will fail when converted by the
  mechanism in Twitter, so you either must use the ugly url in the tweet
  or use a short url. Because you usually want to control the overall
  length you must convert it to a short url before you know how long it
  will be.
 
  In my opinion it wold be better if there was a simple way to generate
  short urls that also identified Wikipedia as such.

 There is an extension for this: ShortURL:

 https://www.mediawiki.org/wiki/Extension:ShortUrl


ShortUrl actually works by assigning a new ID number to represent a *page
title*. This means that shortened links to a particular title will survive
deletion/undeletion etc, and they still rely on redirects to handle page
renames and things.

I proposed using page id instead, but being a title-equivalent makes a lot
of sense for linking since it'll retain the same semantics as linking with
the full title URL.


IIRC this ext was originally devised for the Indic-language wikis, which
tend to have  long illegible URLs because of the way
characters are encoded (nine characters of URL for each character of
title!).

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


Re: [Wikitech-l] About page ID

2012-02-20 Thread Leonard Wallentin

  In my opinion it wold be better if there was a simple way to generate
  short urls that also identified Wikipedia as such.
  
  John
 
 There is an extension for this: ShortURL:
 
 https://www.mediawiki.org/wiki/Extension:ShortUrl

I just tried that out with an external domain on my wiki, and it works very 
well: sasm.at/244 (11 characters) will now redirect to 
säsongsmat.nu/ssm/Recept:Sl%C3%A5nb%C3%A4rssaft_%C3%A0_la_Gusem%C3%A5la (71 
characters)
If someone wants to use it the same way, I wrote a short tutorial here: 
http://blog.xn--ssongsmat-v2a.nu/2012/02/20/creating-a-url-shortener-with-mediawiki/
Leo Wallentin 
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] About page ID

2012-02-19 Thread Sumana Harihareswara
On 02/19/2012 01:10 AM, John Erling Blad wrote:
 Some of the urls to Wikipedia will fail when converted by the
 mechanism in Twitter, so you either must use the ugly url in the tweet
 or use a short url. Because you usually want to control the overall
 length you must convert it to a short url before you know how long it
 will be.
 
 In my opinion it wold be better if there was a simple way to generate
 short urls that also identified Wikipedia as such.
 
 John

There is an extension for this: ShortURL:

https://www.mediawiki.org/wiki/Extension:ShortUrl

It's being reviewed and prepared for deployment on Wikimedia wikis:

https://bugzilla.wikimedia.org/show_bug.cgi?id=1450

https://www.mediawiki.org/wiki/Review_queue

-- 
Sumana Harihareswara
Volunteer Development Coordinator
Wikimedia Foundation

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


[Wikitech-l] About page ID

2012-02-18 Thread Alex Brollo
Is there a sound reason to hidden so well the main id of pages? Is there
any drawback to show it anywhere into wikies, and to use it much largely
for links and API calls?

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


Re: [Wikitech-l] About page ID

2012-02-18 Thread Bináris
2012/2/18 Alex Brollo alex.bro...@gmail.com

 Is there a sound reason to hidden so well the main id of pages? Is there
 any drawback to show it anywhere into wikies, and to use it much largely
 for links and API calls?

 Deleting and restoring/recreating results in a new id, and pages take
their id upon renaming; is the id still useful for linking with these
limitations? I just ask it because it is not perfectly clean for me what
you mean by that.


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


Re: [Wikitech-l] About page ID

2012-02-18 Thread John Erling Blad
In some cases it would be better to linke on article ids than their
names, something like
http://en.wikipedia.org/aid/123456

One example is as a link to an article in Wikipedia from tweet posted
through the Twitter API.

John

On Sat, Feb 18, 2012 at 1:51 PM, Bináris wikipo...@gmail.com wrote:
 2012/2/18 Alex Brollo alex.bro...@gmail.com

 Is there a sound reason to hidden so well the main id of pages? Is there
 any drawback to show it anywhere into wikies, and to use it much largely
 for links and API calls?

 Deleting and restoring/recreating results in a new id, and pages take
 their id upon renaming; is the id still useful for linking with these
 limitations? I just ask it because it is not perfectly clean for me what
 you mean by that.


 --
 Bináris
 ___
 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] About page ID

2012-02-18 Thread Petr Onderka
You can do that, only the URL is slightly longer:

http://en.wikipedia.org/wiki?curid=2312711

Although I don't understand what would be the benefit of doing that.

Petr Onderka
[[User:Svick]]

On Sat, Feb 18, 2012 at 14:09, John Erling Blad jeb...@gmail.com wrote:
 In some cases it would be better to linke on article ids than their
 names, something like
 http://en.wikipedia.org/aid/123456

 One example is as a link to an article in Wikipedia from tweet posted
 through the Twitter API.

 John

 On Sat, Feb 18, 2012 at 1:51 PM, Bináris wikipo...@gmail.com wrote:
 2012/2/18 Alex Brollo alex.bro...@gmail.com

 Is there a sound reason to hidden so well the main id of pages? Is there
 any drawback to show it anywhere into wikies, and to use it much largely
 for links and API calls?

 Deleting and restoring/recreating results in a new id, and pages take
 their id upon renaming; is the id still useful for linking with these
 limitations? I just ask it because it is not perfectly clean for me what
 you mean by that.


 --
 Bináris
 ___
 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] About page ID

2012-02-18 Thread Bergi

Alex Brollo schrieb:

Is there a sound reason to hidden so well the main id of pages? Is there
any drawback to show it anywhere into wikies, and to use it much largely
for links and API calls?


Not for API calls, but for links. For the API you can use 
mw.config.get(wgArticleId) without problems, but there are some 
downsides to use the page ID in regular links:

* a link should show the page title, not just a intransparent number
* pretty urls, see also http://www.mediawiki.org/?curid=2852 (???)
* the id may stay consistent when moving a page, but that should be done 
with redirects. But when a page was deleted, having only the uri 
(http://de.wikipedia.org/?curid=6770594) won't help you anything 
(invalid title). But visiting http://de.wikipedia.org/wiki/Taurmina, 
you will see at least the deletion log.


There was also a discussion at 
http://de.wikipedia.org/wiki/Wikipedia:Projektdiskussion/WP_-_Teil_des_www, 
since then we have a gadget in deWP to show a secont permanent link with 
curid.
For technical documentation you may have a look at 
http://www.mediawiki.org/wiki/Manual:Short_URL.


Regards,
 Bergi

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


Re: [Wikitech-l] About page ID

2012-02-18 Thread John Erling Blad
Yes I know you can do that, and in fact its what I do right now. The
problem is that a few extra chars has a lot of impact in Twitter. A
betetr approach would be if it was legal to write something like
wikipedia.org/en/123456789 (26 chars) compared to
en.wikipedia.org/aid/123456789 (30 chars) or
http://en.wikipedia.org/wiki?curid=123456789 (44 chars). To get around
the problem I use bit.ly for a bot, but its a bit stupid to not handle
this in wikipedia itself.

John

On Sat, Feb 18, 2012 at 2:16 PM, Petr Onderka gsv...@gmail.com wrote:
 You can do that, only the URL is slightly longer:

 http://en.wikipedia.org/wiki?curid=2312711

 Although I don't understand what would be the benefit of doing that.

 Petr Onderka
 [[User:Svick]]

 On Sat, Feb 18, 2012 at 14:09, John Erling Blad jeb...@gmail.com wrote:
 In some cases it would be better to linke on article ids than their
 names, something like
 http://en.wikipedia.org/aid/123456

 One example is as a link to an article in Wikipedia from tweet posted
 through the Twitter API.

 John

 On Sat, Feb 18, 2012 at 1:51 PM, Bináris wikipo...@gmail.com wrote:
 2012/2/18 Alex Brollo alex.bro...@gmail.com

 Is there a sound reason to hidden so well the main id of pages? Is there
 any drawback to show it anywhere into wikies, and to use it much largely
 for links and API calls?

 Deleting and restoring/recreating results in a new id, and pages take
 their id upon renaming; is the id still useful for linking with these
 limitations? I just ask it because it is not perfectly clean for me what
 you mean by that.


 --
 Bináris
 ___
 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

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


Re: [Wikitech-l] About page ID

2012-02-18 Thread Alex Brollo
Thanks! I'll save this talk as a reference.

Really my question was focused on possibile risks or safety issues; it's so
strange that a database (since I see wikisource as a database) is mainly
indexed, from the user's point of view, on a variable field as title of the
page, that I suspected some serious safety issue. And - strangely enough -
id is not shown at all into pages, nor there's any magic word or other user
friendly method to get it.

From a practical point of view, many from wikisource page titles are very
long, often they use non-ascii characters and mixtures of capitalized and
not capitalized characters, they can't be used as they are as local file
names... in brief, I feel all this stuff almost as annoying as the
apostophes used in wiki markup for bold and italic. ;-)

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


Re: [Wikitech-l] About page ID

2012-02-18 Thread MZMcBride
John Erling Blad wrote:
 In some cases it would be better to linke on article ids than their
 names, something like
 http://en.wikipedia.org/aid/123456
 
 One example is as a link to an article in Wikipedia from tweet posted
 through the Twitter API.

People interested in prettier URLs should follow these bugs:

* https://bugzilla.wikimedia.org/1450
* https://bugzilla.wikimedia.org/16659
* https://bugzilla.wikimedia.org/17981

MZMcBride



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


Re: [Wikitech-l] About page ID

2012-02-18 Thread [[w:en:User:Madman]]
On Sat, Feb 18, 2012 at 8:36 AM, John Erling Blad jeb...@gmail.com wrote:
 Yes I know you can do that, and in fact its what I do right now. The
 problem is that a few extra chars has a lot of impact in Twitter. A
 betetr approach would be if it was legal to write something like
 wikipedia.org/en/123456789 (26 chars) compared to
 en.wikipedia.org/aid/123456789 (30 chars) or
 http://en.wikipedia.org/wiki?curid=123456789 (44 chars). To get around
 the problem I use bit.ly for a bot, but its a bit stupid to not handle
 this in wikipedia itself.

This seems moot to me because it's handled in *Twitter* itself. All
URLs in a tweet are converted to t.co shortcuts that are twenty
characters long (while abbreviated versions of the destination URLs
should be shown when the tweet is viewed). More information is here:
http://groups.google.com/group/twitter-api-announce/browse_thread/thread/14d5474c13ed84aa.

Madman

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


Re: [Wikitech-l] About page ID

2012-02-18 Thread John Erling Blad
Some of the urls to Wikipedia will fail when converted by the
mechanism in Twitter, so you either must use the ugly url in the tweet
or use a short url. Because you usually want to control the overall
length you must convert it to a short url before you know how long it
will be.

In my opinion it wold be better if there was a simple way to generate
short urls that also identified Wikipedia as such.

John

On Sun, Feb 19, 2012 at 12:38 AM, [[w:en:User:Madman]]
madman.enw...@gmail.com wrote:
 On Sat, Feb 18, 2012 at 8:36 AM, John Erling Blad jeb...@gmail.com wrote:
 Yes I know you can do that, and in fact its what I do right now. The
 problem is that a few extra chars has a lot of impact in Twitter. A
 betetr approach would be if it was legal to write something like
 wikipedia.org/en/123456789 (26 chars) compared to
 en.wikipedia.org/aid/123456789 (30 chars) or
 http://en.wikipedia.org/wiki?curid=123456789 (44 chars). To get around
 the problem I use bit.ly for a bot, but its a bit stupid to not handle
 this in wikipedia itself.

 This seems moot to me because it's handled in *Twitter* itself. All
 URLs in a tweet are converted to t.co shortcuts that are twenty
 characters long (while abbreviated versions of the destination URLs
 should be shown when the tweet is viewed). More information is here:
 http://groups.google.com/group/twitter-api-announce/browse_thread/thread/14d5474c13ed84aa.

 Madman

 ___
 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