[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wikipedia-l
Subject:    Re: [Wikipedia-l] How to get backlinks
From:       Petr Kadlec <petr.kadlec () gmail ! com>
Date:       2009-01-20 14:07:44
Message-ID: a33869c80901200607x66ed058fy6133405c862da0cf () mail ! gmail ! com
[Download RAW message or body]

2009/1/18 Ankuj Gupta <ankuj2004@gmail.com>:
> I am working on my project based on wikipedia. For that i require
> number of backlinks for each page in wiki.Is it possible to find them
> using the pagelinks table.

Yes, you can use the pagelinks table for that. You need something like

SELECT COUNT(*) FROM pagelinks WHERE pl_namespace=0 AND pl_title='Page_title'

> Or it there some other method. I tried the
> mediawiki-api as well but was not able to understand how they can be
> used.

AFAIK, there is no method to get a *count* of backlinks in the API;
you could get a complete list with something like
http://en.wikipedia.org/w/api.php?action=query&list=backlinks&bltitle=Ook
and count those, but that would be wasting resources.

HTH,
-- [[cs:User:Mormegil | Petr Kadlec]]

_______________________________________________
Wikipedia-l mailing list
Wikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikipedia-l
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic