No project description provided
Project description
Medium Muncher
Medium makes content readily available for machine consumption through the format=json param, and content feeds via the feeds path, however the XML and JSON responses are not exactly plug-and-play for redisplaying content. Enter this package.
Installation
via pip with
pip3 install mediummuncher
Usage
Getting a story as stand-alone HTML (with head and body tags)
from medium_muncher import MediumMuncher
muncher = MediumMuncher()
full_html=muncher.munch_story('https://medium.com/some-author/some-amazing-article-039525')
#returns "<!doctype html><head>... "
Getting a story as an html snippet (no head or body)
html_snippet=muncher.munch_story('https://medium.com/some-author/some-amazing-article-039525',snippet=True)
#returns "<p>article text!..."
Using the verbose flag returns a tuple with the html and a dictionary of interesting article attributes such as title, published date etc.
html_snippet=muncher.munch_story('https://medium.com/some-author/some-amazing-article-039525',snippet=True, verbose=True)
#returns tuple ("<p>article text!...", {"title":"this amazing article"...,)
Getting all the story urls for a given author
stories=muncher.munch_author_feed('some-author')
#returns tuple ("https://medium.com/some-author/amazing-article-one-12902990",..,)
Putting it all together to extract all stories for a given author
stories=list()
for url in muncher.munch_author_feed('ethan.m.knox'):
stories.append(muncher.munch_story( url,
snippet=True,
verbose=True))
print(list)
Contributing
Please feel free to fork and PR! Can always use another helping hand.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mediumMuncher-0.2.0.tar.gz.
File metadata
- Download URL: mediumMuncher-0.2.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca62a5853a1eaca90dfd97f47ba8d14357360dbb2bbda60eebca593cc8872daf
|
|
| MD5 |
c4d633811214c405ff5a373efc183cdf
|
|
| BLAKE2b-256 |
23938ec95dd21c66e1d90716b3553f51c29d477c54c95a2dac31885a0f274a64
|
File details
Details for the file mediumMuncher-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mediumMuncher-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aeb4416dffe266d0ac674070b8a51d3fb6b40832728f3f304c40d256ef7d6c36
|
|
| MD5 |
179f9d1122d2e21865d8090c3500a08b
|
|
| BLAKE2b-256 |
787a601e84a1d0be89b0c8bb11760748a58256c2adb5cdc16c1cba82c5a6d2ab
|