API:Iwbacklinks/tr
![]() | Bu sayfa MediaWiki Eylem API'si belgelerinin bir parçasıdır. |
Verilen vikiarası bağlantısına bağlantı veren tüm sayfaları almak için GET isteği.
MediaWiki sürümü: | ≥ 1.17 |
API belgesi
![]() | Aşağıdaki belgelendirme, bu sitede (MediaWiki.org) çalışan MediaWiki'nin sürüm öncesi sürümü tarafından otomatik olarak oluşturulan Special: |
list=iwbacklinks (iwbl)
- This module requires read rights.
- This module can be used as a generator.
- Source: MediaWiki
- License: GPL-2.0-or-later
Find all pages that link to the given interwiki link.
Can be used to find all links with a prefix, or all links to a title (with a given prefix). Using neither parameter is effectively "all interwiki links".
Specific parameters:
Other general parameters are available.
- iwblprefix
Prefix for the interwiki.
- iwbltitle
Interwiki link to search for. Must be used with iwblblprefix.
- iwblcontinue
When more results are available, use this to continue. More detailed information on how to continue queries can be found on mediawiki.org.
- iwbllimit
How many total pages to return.
- Type: integer or max
- The value must be between 1 and 500.
- Default: 10
- iwblprop
Which properties to get:
- iwprefix
- Adds the prefix of the interwiki.
- iwtitle
- Adds the title of the interwiki.
- Values (separate with | or alternative): iwprefix, iwtitle
- Default: (empty)
- iwbldir
The direction in which to list.
- One of the following values: ascending, descending
- Default: ascending
Examples:
- Get pages linking to wikibooks:Test.
- api.php?action=query&list=iwbacklinks&iwbltitle=Test&iwblprefix=wikibooks [open in sandbox]
- Get information about pages linking to wikibooks:Test.
- api.php?action=query&generator=iwbacklinks&giwbltitle=Test&giwblprefix=wikibooks&prop=info [open in sandbox]
Örnek
GET isteği
Get pages that link to a given interwiki link.
api.php? action=query& list=iwbacklinks& iwblprefix=wikibooks& iwbltitle=Main_Page& format=json [ApiSandbox'ta deneyin]
Yanıt
{
"batchcomplete": "",
"continue": {
"iwblcontinue": "wikibooks|Main_Page|438739",
"continue": "-||"
},
"query": {
"iwbacklinks": [
{
"pageid": 18606,
"ns": 0,
"title": "Liberation Tigers of Tamil Eelam"
},
{
"pageid": 43347,
"ns": 1,
"title": "Talk:Vi"
},
...
]
}
}
Örnek kod
Python
#!/usr/bin/python3
"""
iwbacklinks.py
MediaWiki API Demos
Demo of `Iwbacklinks` module: Get pages that link to a given interwiki link.
MIT License
"""
import requests
S = requests.Session()
URL = "https://en.wikipedia.org/w/api.php"
PARAMS = {
"action": "query",
"list": "iwbacklinks",
"iwblprefix": "wikibooks",
"iwbltitle": "Main_Page",
"format": "json"
}
R = S.get(url=URL, params=PARAMS)
DATA = R.json()
print(DATA)
PHP
<?php
/*
iwbacklinks.php
MediaWiki API Demos
Demo of `Iwbacklinks` module: Get pages that link to a given interwiki link.
MIT License
*/
$endPoint = "https://en.wikipedia.org/w/api.php";
$params = [
"action" => "query",
"list" => "iwbacklinks",
"iwblprefix" => "wikibooks",
"iwbltitle" => "Main_Page",
"format" => "json"
];
$url = $endPoint . "?" . http_build_query( $params );
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
$output = curl_exec( $ch );
curl_close( $ch );
echo( $output );
JavaScript
/*
iwbacklinks.js
MediaWiki API Demos
Demo of `Iwbacklinks` module: Get pages that link to a given interwiki link.
MIT License
*/
var url = "https://en.wikipedia.org/w/api.php";
var params = {
action: "query",
list: "iwbacklinks",
iwblprefix: "wikibooks",
iwbltitle: "Main_Page",
format: "json"
};
url = url + "?origin=*";
Object.keys(params).forEach(function(key){url += "&" + key + "=" + params[key];});
fetch(url)
.then(function(response){return response.json();})
.then(function(response) {console.log(response);})
.catch(function(error){console.log(error);});
MediaWiki JS
/*
iwbacklinks.js
MediaWiki API Demos
Demo of `Iwbacklinks` module: Get pages that link to a given interwiki link.
MIT License
*/
var params = {
action: 'query',
list: 'iwbacklinks',
iwblprefix: 'wikibooks',
iwbltitle: 'Main_Page',
format: 'json'
},
api = new mw.Api();
api.get( params ).done( function ( data ) {
console.log( data );
} );
Olası hatalar
Kod | Bilgi |
---|---|
invalidparammix-mustusewith | iwbltitle parametresi yalnızca iwblprefix ile kullanılabilir. |
Parametre geçmişi
- v1.20:
iwbldir
tanıtıldı
Ek notlar
- Bu modül, verilen vikiarası bağlantısına bağlantı veren tüm sayfaları bulmak için kullanılabilir. Bir önek kullanan tüm bağlantıları veya belirli bir başlığa (belirli bir önekle) giden tüm bağlantıları bulur. Her iki parametrenin kullanılması
All IW Links
döndürmez.
Ayrıca bakınız
- API:Iwlinks - Belirli bir sayfadaki vikiarası bağlantılarını listeleyin.
- API:Links - Sağlanan sayfalardaki tüm bağlantıları bulun.
- API:Linkshere - Verilen sayfalara bağlantı veren tüm sayfaları bulun.
- API:Extlinks - Sağlanan sayfalardaki tüm harici bağlantıların bir listesini alır.