reference-feed-info-detail.rst 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .. _reference.feed.info_detail:
  2. :py:attr:`feed.info_detail`
  3. ===========================
  4. A dictionary with details about the feed info.
  5. .. rubric:: Comes from
  6. * /atom03:feed/atom03:info
  7. .. seealso::
  8. * :ref:`reference.feed.info`
  9. .. _reference.feed.info_detail.value:
  10. :py:attr:`feed.info_detail.value`
  11. ---------------------------------
  12. Same as :ref:`reference.feed.info`.
  13. If this contains :abbr:`HTML (HyperText Markup Language)` or :abbr:`XHTML
  14. (Extensible HyperText Markup Language)`, it is :ref:`sanitized
  15. <advanced.sanitization>` by default.
  16. If this contains :abbr:`HTML (HyperText Markup Language)` or :abbr:`XHTML
  17. (Extensible HyperText Markup Language)`, certain (X)HTML elements within this
  18. value may contain relative :abbr:`URI (Uniform Resource Identifier)`s. If so,
  19. they are :ref:`resolved according to a set of rules <advanced.base>`.
  20. .. _reference.feed.info_detail.type:
  21. :py:attr:`feed.info_detail.type`
  22. --------------------------------
  23. The content type of the feed info.
  24. Most likely values for :py:attr:`~feed.info_detail.type`:
  25. * :mimetype:`text/plain`
  26. * :mimetype:`text/html`
  27. * :mimetype:`application/xhtml+xml`
  28. For Atom feeds, the content type is taken from the type attribute, which
  29. defaults to :mimetype:`text/plain` if not specified. For :abbr:`RSS (Rich Site
  30. Summary)` feeds, the content type is auto-determined by inspecting the content,
  31. and defaults to :mimetype:`text/html`. Note that this may cause silent data
  32. loss if the value contains plain text with angle brackets. There is nothing I
  33. can do about this problem; it is a limitation of :abbr:`RSS (Rich Site
  34. Summary)`.
  35. Future enhancement: some versions of :abbr:`RSS (Rich Site Summary)` clearly
  36. specify that certain values default to :mimetype:`text/plain`, and
  37. :program:`Universal Feed Parser` should respect this, but it doesn't yet.
  38. :py:attr:`feed.info_detail.language`
  39. ------------------------------------
  40. The language of the feed info.
  41. :py:attr:`~feed.info_detail.language` is supposed to be a language code, as
  42. specified by `:abbr:`RFC (Request For Comments)` 3066
  43. <http://www.ietf.org/rfc/rfc3066.txt>`_, but publishers have been known to
  44. publish random values like "English" or "German". :program:`Universal Feed
  45. Parser` does not do any parsing or normalization of language codes.
  46. :py:attr:`~feed.info_detail.language` may come from the element's xml:lang
  47. attribute, or it may inherit from a parent element's xml:lang, or the
  48. Content-Language :abbr:`HTTP (Hypertext Transfer Protocol)` header. If the
  49. feed does not specify a language, :py:attr:`~feed.info_detail.language` will be
  50. ``None``, the :program:`Python` null value.
  51. :py:attr:`feed.info_detail.base`
  52. --------------------------------
  53. The original base :abbr:`URI (Uniform Resource Identifier)` for links within
  54. the feed copyright.
  55. :py:attr:`~feed.info_detail.base` is only useful in rare situations and can
  56. usually be ignored. It is the original base :abbr:`URI (Uniform Resource
  57. Identifier)` for this value, as specified by the element's xml:base attribute,
  58. or a parent element's xml:base, or the appropriate :abbr:`HTTP (Hypertext
  59. Transfer Protocol)` header, or the :abbr:`URI (Uniform Resource Identifier)` of
  60. the feed. (See :ref:`advanced.base` for more details.) By the time you see
  61. it, :program:`Universal Feed Parser` has already resolved relative links in all
  62. values where it makes sense to do so. *Clients should never need to manually
  63. resolve relative links.*