File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ either as seconds or as `RFC 2326`_ Normal Play Time (NPT).
4242Example
4343=======
4444
45+ Using the built-in ``urllib.request `` module from Python 3:
46+
4547.. code-block :: python
4648
4749 import podcastparser
@@ -57,6 +59,27 @@ Example
5759
5860.. TODO: Show example dict for a parsed feed with all fields
5961
62+
63+ Using `Requests `_:
64+
65+ .. code-block :: python
66+
67+ import podcastparser
68+ import requests
69+
70+ url = ' https://example.net/podcast.atom'
71+
72+ with requests.get(url, stream = True ) as response:
73+ response.raw.decode_content = True
74+ parsed = podcastparser.parse(url, response.raw)
75+
76+ # parsed is a dict
77+ import pprint
78+ pprint.pprint(parsed)
79+
80+ .. _Requests : https://requests.readthedocs.io
81+
82+
6083Supported XML Elements and Attributes
6184=====================================
6285
You can’t perform that action at this time.
0 commit comments