Jump to content

Manual:Parameters to Special:Export/ha

From mediawiki.org
This page is a translated version of the page Manual:Parameters to Special:Export and the translation is 40% complete.
Outdated translations are marked like this.

See also: Manual:DumpBackup.php

Ana iya fitar da shafukan Wiki a cikin tsari na musamman XML zuwa a lodawa zuwa wani MediaWiki.[1] Duba Help:Export don ƙarin bayani.

Available parameters

Below is the list of available parameters for Special:Export as of version 1.16. Not all of these are available through the Special:Export UI.

Parameter Variable type Bayani
action String Mara amfani; saita zuwa "submit" a cikin sigar fitarwa.
Page Selection
/ (babu siga) Yana zaɓar har zuwa shafi ɗaya, misali. Special:Export/Sandbox.
pages ? Jerin taken shafi, wanda aka raba ta hanyar layi (%0A) haruffa. Matsakaicin shafuka 35.
addcat/category-name String? An ƙara waɗannan daga baya. addcat yana mayar da duk membobi na rukunin catname da aka ƙara mata. Idan $wgExportFromNamespaces an kunna, addns da nsindex suna yin iri ɗaya, amma tare da wuraren suna da fihirisarsu. Za a mayar da iyakar taken shafi 5000.

Misali, mai zuwa na duk shafuka ne a cikin en:Category:Books:

https://en.wikipedia.org/w/index.php?title=Special:Export&addcat&catname=Books&pages=XXXX

addns/namespace-index
Sorting
dir[2] String Ya kamata a saita zuwa "desc" don dawo da bita ta baya tsarin lokaci.

Tsohuwar, tare da wannan sigar da aka tsallake, shine a dawo da bita a cikin tsarin hawan lokaci (mafi tsoho zuwa sabo-bi).

Limiting Results
offset[2] ? Tambarin lokutan da za a fara, wanda ba ya haɗawa. Tambarin lokaci na iya kasancewa cikin nau'i-nau'i da yawa, gami da tsarin haruffa 14 da MediaWiki ke amfani da shi, da kuma tsarin ISO 8601 kamar wanda ake fitarwa ta jujjuyawar XML.
limit[2] Integer Matsakaicin adadin sake dubawa don dawowa. Idan kuna buƙatar fiye da ƙayyadaddun takamaiman rukunin yanar gizo (wanda aka bayyana a $wgExportMaxHistory : 1000 akan ayyukan Wikimedia a halin yanzu), za a rage shi zuwa wannan lamba.

Wannan iyaka yana tarawa a duk shafukan da aka kayyade a cikin sigar shafukan. Misali, idan ka nemi iyaka 100, na shafuka biyu masu bita 70 kowanne, zaka sami 70 daga daya da 30 daga daya.[3]

curonly Boolean Include only the current revision (default for GET requests).
history ? Haɗa cikakken tarihin, wanda ya wuce dir, limit, da offset.

Wannan baya aiki don duk faɗin https://en.wikipedia.org/w/index.php?title=Special:Export&pages=US_Open_(tennis)&history=1&action=submit yana aiki lafiya kuma yana ba da duk bita amma https://en.wikipedia.org/w/index.php?title=Special:Export&pages=India&history=1&action=submit baya yi.

Extras
templates ? Includes any transcluded templates on any pages listed for export.
listauthors Boolean Include a list of all contributors' names and user IDs for each page. An kashe aiki ta tsohuwa; ana iya kunna ta ta canza $wgExportAllowListContributors .
pagelink-depth Integer Includes any linked pages to the depth specified. Iyakance zuwa $wgExportMaxLinkDepth (tsoho zuwa 0, kashe fasalin), ko 5 idan mai amfani bashi da izinin canza iyaka.
wpDownload ? Save as file, named with current time stamp. An aiwatar ta hanyar content-disposition:abin da aka makala HTTP header.

URL parameter requests do not work

Ma'auni na dir, offset da limit kawai suna aiki don Buƙatun POST. GET requests through a URL are ignored.

When you use the URL as in a browser, you are submitting via GET. In the ruby script, you are using POST.

Misali, buqatar siga mai zuwa baya aiki, tana mayar da duk bitar shafi duk da iyakar siga=5.

https://en.wikipedia.org/w/index.php?title=Special:Export&pages=XXXX&offset=1&limit=5&action=submit

Retrieving earliest 5 revisions

cURL ne ke samar da buƙatun POST lokacin wucewa -d "". The following retrieves the earliest 5 revisions from the English Wikipedia main page and its talk page:

curl -d "" 'https://en.wikipedia.org/w/index.php?title=Special:Export&pages=Main_Page%0ATalk:Main_Page&offset=1&limit=5&action=submit'

And here are the next 5 revisions of the main page only:

curl -d "" 'https://en.wikipedia.org/w/index.php?title=Special:Export&pages=Main_Page&offset=2002-01-27T20:25:56Z&limit=5&action=submit'

Here the timestamp from the last revision of the previous query is copied into the offset field of the URL. Saboda filin kashewa baya haɗawa, wannan bita na 5 ba a sake nunawa ba, kuma a maimakon haka muna samun bita 6-10.[4]

POST request to download

Misali mafi bayyane, musamman idan kuna son adana abin darn, zai kasance

curl -d "&pages=Main_Page&offset=1&action=submit" https://en.wikipedia.org/w/index.php?title=Special:Export -o "somefilename.xml"

Tushen URL yana buƙatar bin sigogin MediaWiki… kuma, lura cewa kuna buƙatar ƙara sigogin curl a ƙarshen don adana fayil ɗin azaman wani abu. Otherwise it will just scroll on your screen and nothing will be saved. Currently, it appears that Wikipedia servers are under maintenance, hence the above method is showing error and not providing the xml.

Idan a maimakon haka kuna da jerin sunayen laƙabi a cikin fayil, faɗi title-list, dole ne ku wuce jerin a matsayin siga don murƙushewa da ɓoye bayanan layin daidai (saboda wasu dalilai, --data-urlencode da @ ba sa aiki):

curl -d "&action=submit&pages=$(cat title-list | hexdump -v -e '/1 "%02x"' | sed 's/\(..\)/%\1/g' )" https://en.wikipedia.org/w/index.php?title=Special:Export -o "somefilename.xml"

If you want to save bandwidth, append the following arguments as well:

--compressed -H 'Accept-Encoding: gzip,deflate'

Stopping the export of your MediaWiki

Please keep in mind that making it difficult for your users to back up their work could discourage them from contributing to your wiki.

Idan $wgExportAllowHistory an saita zuwa karya a cikin LocalSettings.php , sigar yanzu kawai za a iya fitarwa, ba cikakken tarihin ba.

By default with GET requests, only the current (last) version of each page is returned.

Idan ma'aunin $wgExportAllowHistory gaskiya ne a cikin LocalSettings.php , kuma "Haɗa kawai bita na yanzu, ba cikakken tarihin ba" ba a bincika ba, to ana mayar da duk nau'ikan kowane shafi.

Don musaki fitarwa gaba ɗaya, kuna buƙatar saita aikin dawo da kira a cikin LocalSettings.php:

function removeExportSpecial(&$aSpecialPages)
{
	unset($aSpecialPages['Export']);
	return true;
}
$wgHooks['SpecialPage_initList'][] = 'removeExportSpecial';

Idan kuna son ayyana izini don fitarwa, sanya waɗannan abubuwan a cikin LocalSettings.php:

// Override SpecialExport, which is work for MW1.35
// the parameters of __construct() are changed in later versions
class SpecialExport2 extends SpecialExport {
    public function __construct() {
        parent::__construct();
        $this->mRestriction = 'export';
    }
    public function execute( $par ) {
        $this->checkPermissions();
        parent::execute( $par );
    }
}
function adjustExportSpecial(&$aSpecialPages)
{
	$aSpecialPages['Export'] = SpecialExport2::class;
	return true;
}
$wgHooks['SpecialPage_initList'][] = 'adjustExportSpecial';
$wgGroupPermissions['sysop']['export'] = true; // Add export permission to sysop only

Keep in mind that exporting is still possible, if you have the API enabled.

Notes

  1. Idan an kunna wannan aikin akan wurin wiki, kuma mai amfani shine sysop a wurin. Ana iya amfani da fitarwa don nazarin abun ciki. Duba kuma Ciyarwar haɗin gwiwa don fitar da wasu bayanai amma shafuka da Taimako: Shigowa akan shigo da shafuka.
  2. 2.0 2.1 2.2 Ana watsi da waɗannan sigogi idan an ba da ko dai curonly ko history, ko kuma idan an wuce ta hanyar buƙatun GET (misali, mashaya adireshin burauza). Duba Buƙatun sigar URL ba sa aiki don ƙarin bayani.
  3. Odar ta page_id ne, shafuka masu ƙananan page_id suna samun ƙarin bita. Dalilin wannan shine na Musamman:Export kawai ya taɓa yin tambayar bayanan bayanai guda ɗaya akan buƙatun HTTP. Idan kana so ka nemi duk tarihin shafuka da yawa tare da bita-bita da yawa kowanne, dole ne ka yi shi shafi ɗaya a lokaci guda.
  4. Wannan ma'auni yana kama da na shafukan tarihin UI.

See also