API:Beitragsfeed
Appearance
From mediawiki.org
This page is a translated version of the page API:Feedcontributions and the translation is 100% complete.
Diese Seite ist Teil der Dokumentation der MediaWiki action API.
| MediaWiki Action API |
|---|
| Grundlagen |
| Authentifizierung |
| Benutzerkonten und Benutzer |
| Seitenoperationen |
|
| Suche |
| Entwicklerwerkzeuge |
| Tutorials |
| v · d · e |
MediaWiki Version:
≥ 1.18
GET-Abfrage um den Beitragsfeed eines Benutzers auszugeben.
API-Dokumentation
Die folgende Dokumentation ist die Ausgabe von Special: ApiHelp/ feedcontributions, die automatisch von der vorveröffentlichten MediaWiki-Version generiert wird, die auf dieser Seite (MediaWiki.org) läuft.
action=feedcontributions
(main | feedcontributions)
- This module requires read rights.
- Source: MediaWiki
- License: GPL-2.0-or-later
Returns a user's contributions feed.
Specific parameters:
Other general parameters are available.
- feedformat
The format of the feed.
- One of the following values: atom, rss
- Default: rss
- user
What users to get the contributions for.
- This parameter is required.
- Type: user, by any of username, IP, Temporary user, IP range, interwiki name (e.g. "prefix>ExampleName") and user ID (e.g. "#12345")
- namespace
Which namespace to filter the contributions by.
- One of the following values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 90, 91, 92, 93, 100, 101, 102, 103, 104, 105, 106, 107, 710, 711, 828, 829, 1198, 1199, 1728, 1729, 2600, 5500, 5501
- year
From year (and earlier).
- Type: integer
- month
From month (and earlier).
- Type: integer
- tagfilter
Filter contributions that have these tags.
- Values (separate with | or alternative): AWB, Blocked user editing own talk page, New user editing project page, OAuth CID: 21, OAuth CID: 31, OAuth CID: 429, OAuth CID: 1188, OAuth CID: 1261, OAuth CID: 1352, OAuth CID: 1805, OAuth CID: 1809, OAuth CID: 1841, OAuth CID: 2071, OAuth CID: 4458, OAuth CID: 4664, OAuth CID: 5481, OAuth CID: 6365, Potentially problematic translation, Rapid reverts, T144167, abusefilter-condition-limit, advanced mobile edit, android app edit, app-ai-assist, app-description-add, app-description-change, app-description-translate, app-full-source, app-image-add-infobox, app-image-add-top, app-image-caption-add, app-image-caption-translate, app-image-tag-add, app-rollback, app-section-source, app-select-source, app-suggestededit, app-talk-reply, app-talk-source, app-talk-topic, app-undo, centralnotice, centralnotice translation, chart-wizard, community configuration, convenient-discussions, deletion template removed, disambiguator-link-added, discussiontools, discussiontools-added-comment, discussiontools-edit, discussiontools-newtopic, discussiontools-reply, discussiontools-source, discussiontools-source-enhanced, discussiontools-visual, editcheck-newcontent, editcheck-newreference, editcheck-paste-shown, editcheck-reference-decline-common-knowledge, editcheck-reference-decline-irrelevant, editcheck-reference-decline-other, editcheck-reference-decline-uncertain, editcheck-references, editcheck-references-activated, editcheck-references-shown, editcheck-tone, editcheck-tone-shown, editsuggestion-seen, editsuggestion-used, emoji, fileimporter-remote, ios app edit, massmessage-delivery, meta spam id, mobile app edit, mobile edit, mobile web edit, mw-blank, mw-changed-redirect-target, mw-contentmodelchange, mw-edited-other-users-css, mw-edited-other-users-js, mw-ipblock-appeal, mw-manual-revert, mw-new-redirect, mw-recreated, mw-removed-redirect, mw-replace, mw-reverted, mw-rollback, mw-server-side-upload, mw-undo, nuke, parsermigration-visual-bug, repeated xwiki CoI abuse, translate-translation-pages, visualeditor, visualeditor-needcheck, visualeditor-switched, visualeditor-wikitext, wikieditor, wikilove
- Maximum number of values is 50 (500 for clients that are allowed higher limits).
- Default: (empty)
- deletedonly
Show only deleted contributions.
- Type: boolean (details)
- toponly
Only show edits that are the latest revisions.
- Type: boolean (details)
- newonly
Only show edits that are page creations.
- Type: boolean (details)
- hideminor
Hide minor edits.
- Type: boolean (details)
- showsizediff
Disabled due to miser mode.
- Type: boolean (details)
Example:
- Return contributions for user Example.
- api.php?action=feedcontributions&user=Example [open in sandbox]
Beispiel
GET-Anfrage
Zeige Beiträge eines Benutzers als RSS-Feed an.
Antwort
<rssxmlns:dc="http://purl.org/dc/elements/1.1/"version="2.0"> <channel> <title>Wikipedia-Usercontributions[en]</title> <link> https://en.wikipedia.org/wiki/Special:Contributions/Jimbo_Wales </link> <description>Usercontributions</description> <language>en</language> <generator>MediaWiki1.27.0-wmf.5</generator> <lastBuildDate>Wed,11Nov201520:56:27GMT</lastBuildDate> <item> <title>Usertalk:JimboWales</title> <link> https://en.wikipedia.org/w/index.php?title=User_talk:Jimbo_Wales&diff=### </link> <guidisPermaLink="false"> https://en.wikipedia.org/w/index.php?title=User_talk:Jimbo_Wales&diff=### </guid> <description> ... </description> <comments> https://en.wikipedia.org/wiki/User_talk:Jimbo_Wales </comments> </item> </channel> </rss>
Beispielcode
Python
#!/usr/bin/python3 """ get_user_contributions_feed.py MediaWiki API Demos Demo of `Feedcontributions` module: Show contributions of a user as an RSS feed. MIT License """ importrequests S = requests.Session() URL = "https://en.wikipedia.org/w/api.php" PARAMS = { "action": "feedcontributions", "user": "Jimbo Wales", "format": "json" } R = S.get(url=URL, params=PARAMS) DATA = R.content print(DATA)
PHP
<?php /* get_user_contributions_feed.php MediaWiki API Demos Demo of `Feedcontributions` module: Show contributions of a user as an RSS feed. MIT License */ $endPoint = "https://en.wikipedia.org/w/api.php"; $params = [ "action" => "feedcontributions", "user" => "Jimbo Wales", "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 ); var_dump( $output );
JavaScript
/* get_user_contributions_feed.js MediaWiki API Demos Demo of `Feedcontributions` module: Show contributions of a user as an RSS feed. MIT License */ varurl="https://en.wikipedia.org/w/api.php"; varparams={ action:"feedcontributions", user:"Jimbo Wales", format:"json" }; url=url+"?origin=*"; Object.keys(params).forEach(function(key){url+="&"+key+"="+params[key];}); fetch(url) .then(function(response){returnresponse.json();}) .then(function(response){console.log(response);}) .catch(function(error){console.log(error);});
MediaWiki JS
/* get_user_contributions_feed.js MediaWiki API Demos Demo of `Feedcontributions` module: Show contributions of a user as an RSS feed. MIT License */ varparams={ action:'feedcontributions', user:'Jimbo Wales', format:'json' }, api=newmw.Api(); api.get(params).done(function(data){ console.log(data); });
Mögliche Fehler
Zusätzlich zu den Standard-Fehlernachrichten:
| Code | Information |
|---|---|
| feed-unavailable | Es stehen keine Feeds zur Verfügung. |
| feed-invalid | Ungültiger Feed-Abonnement-Typ. |
| sizediffdisabled | Der Größenunterschied ist im Misermodus deaktiviert. |
Parametergeschichte
- v1.28: Eingeführt
hideminor - v1.23: Eingeführt
newonly
Zusätzliche Anmerkungen
- Beachte, dass wenn die Abfrage erfolgreich ist, die Ausgabe in dem Format erfolgt, das durch den Parameter
feedformatvorgegeben wird. Das durch den Standardparameterformatvorgegebene Format (z.B. JSON) wird nur genutzt, wenn ein Fehler auftritt.
Siehe auch
- API:Letzte-Änderungen-Feed - Gibt eine Liste der letzten Änderungen aus.
- API:Feedwatchlist - Gibt einen Beobachtungslistenfeed aus.