Guten Tag,
bin schon seit mehreren Tagen am probieren die API richtig anzusprechen aber ich kann einfach nicht die richtige Kombination finden. Ich möchte lediglich den ersten Abschnitt des Wiki Artikels in Klartext extrahieren. Komme allerdings nur auf folgende Lösungen die eine Mischung aus Wiki-Zeugs und HTML ist:
"<p><b>Polen</b> (polnisch <i>Polska</i> [ˈpɔlska] <i>Anhören</i><sup>?/i</sup>, amtlich <i>Rzeczpospolita Polska</i>, [ʐɛʈ͡ʂpɔsˈpɔlita ˈpɔlska]<sup>?/i</sup>, deutsch <i>Republik Polen</i>) ist eine parlamentarische Republik in Mitteleuropa. [...]"
https://de.wikipedia.org/w/api.php?action=query&format=xml&prop=extracts&ex…
brauche aber lediglich:
"Polen (polnisch Polska [ˈpɔlska], amtlich Rzeczpospolita Polska, [ʐɛʈ͡ʂpɔsˈpɔlita ˈpɔlska], deutsch Republik Polen) ist eine parlamentarische Republik in Mitteleuropa. [...]"
Hab es versucht mit replaces und anderen Befehlen zu bereinigen aber so richtig professionell ist das ja auch nicht.
Gibts noch eine andere Möglichkeit?
Beste Grüße
Bahlox
mediawiki-api(a)lists.wikimedia.org
Hi, All,
I found in some of the UPLOAD update, there is no page id:
<rc type="log" ns="6" title="File:Lucian A. Sperta- Nunez.jpg" rcid="
114549183" pageid="0" revid="0" old_revid="0" user="Azarel63"oldlen="0"
newlen="0" timestamp="2014-01-05T11:09:38Z" comment="User created page with
UploadWizard" logid="77242320" logtype="upload"logaction="upload" img_sha1="
sf9t03wg27tl73nnde3jzfuxncefux9" img_timestamp="2014-01-05T11:09:36Z"/>
<rc type="log" ns="6" title="File:Gingerbread spices (annotated).jpg" rcid="
114549185" pageid="30485540" revid="0" old_revid="0"user="SKopp" oldlen="0"
newlen="0" timestamp="2014-01-05T11:09:37Z" comment="User created page with
UploadWizard" logid="77242318"logtype="upload" logaction="upload" img_sha1="
q84abqjr2n4bmn7o6j4uovpl5ufs2gq" img_timestamp="2014-01-05T11:09:37Z"/>
The first one has no page id but the second one has.
Does anybody can tell me the differences?
Thanks,
Ethan Liu
With Gerrit change 174200,[1] an HTTP header "Api-User-Agent" header will
be recognized for logging from the API. This should benefit clients using
XMLHttpRequest where the normal User-Agent header is locked down by the
browser. The logged agent will be the concatenation of Api-User-Agent and
the browser's User-Agent header.
This should come in handy once the ApiFeatureUsage extension[2][3] is
reviewed and deployed.
The new header will be recognized starting with 1.25wmf10, see
https://www.mediawiki.org/wiki/MediaWiki_1.25/Roadmap for the schedule. It
will be ignored for wikis still on 1.25wmf8 or 1.25wmf9, so feel free to
upgrade any scripts immediately. Bots and other clients that have full
control over the User-Agent header should continue to use that header
exclusively.
[1]: https://gerrit.wikimedia.org/r/#/c/174200/
[2]: https://www.mediawiki.org/wiki/Extension:ApiFeatureUsage
[3]:
https://www.mediawiki.org/wiki/API/Architecture_work/Planning#Deprecated_AP…
--
Brad Jorsch (Anomie)
Software Engineer
Wikimedia Foundation
_______________________________________________
Mediawiki-api-announce mailing list
Mediawiki-api-announce(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce