https://bugzilla.wikimedia.org/show_bug.cgi?id=70682

            Bug ID: 70682
           Summary: Implement extracts in Pywikibot
           Product: Pywikibot
           Version: core (2.0)
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: Unprioritized
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]
       Web browser: ---
   Mobile Platform: ---

Mediawiki has the extracts api function. It should be implemented in Pywikibot
too.

* prop=extracts (ex) *
  Returns plain-text or limited HTML extracts of the given page(s)
  https://www.mediawiki.org/wiki/Extension:TextExtracts#API

This module requires read rights
Parameters:
  exchars             - How many characters to return, actual text returned
might be slightly longer.
                        The value must be no less than 1
  exsentences         - How many sentences to return
                        The value must be between 1 and 10
  exlimit             - How many extracts to return
                        No more than 20 (20 for bots) allowed
                        Default: 1
  exintro             - Return only content before the first section
  explaintext         - Return extracts as plaintext instead of limited HTML
  exsectionformat     - How to format sections in plaintext mode:
                         plain - No formatting
                         wiki - Wikitext-style formatting == like this ==
                         raw - This module's internal representation (section
titles prefixed with <ASCII 1><ASCII 2><section level><ASCII 2><ASCII 1>
                        One value: plain, wiki, raw
                        Default: wiki
  excontinue          - When more results are available, use this to continue
  exvariant           - Convert content into this language variant`
Example:
  Get a 175-character extract:
    api.php?action=query&prop=extracts&exchars=175&titles=Therion

https://nl.wikipedia.org/w/api.php?action=query&prop=extracts&exchars=175&titles=Nicolaas_IJzendoorn&format=json

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to