A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

category.py 500 B

123456789101112131415161718
  1. # -*- coding: utf-8 -*-
  2. from wiki.tools.page import Page
  3. class Category(Page):
  4. """
  5. EarwigBot's Wiki Toolset: Category Class
  6. """
  7. def get_members(self, limit=50):
  8. """
  9. Docstring needed
  10. """
  11. params = {"action": "query", "list": "categorymembers",
  12. "cmlimit": limit, "cmtitle": self.title}
  13. result = self.site.api_query(params)
  14. members = result['query']['categorymembers']
  15. return [member["title"] for member in members]