No project description provided
Project description
Ninegagposts
This is a python client to get 9Gag posts
Installation
Ninegagposts requires Python 3.6+ to run.
$ pip install ninegagposts
Examples
Get Last Post:
from ninegagposts import Client Client.get_last_post() #returns a dictionary
Output Example:
{ "id": "aB07d02", "url": "http://9gag.com/gag/aB07d02", "title": "I gotta get one of those", "type": "Animated", "nsfw": 0, "upVoteCount": 0, "downVoteCount": 0, "creationTs": 1562853914, "promoted": 0, "isVoteMasked": 1, "hasLongPostCover": 0, "images": { "image700": { "width": 460, "height": 571, "url": "https://img-9gag-fun.9cache.com/photo/aB07d02_460s.jpg" }, "image460": { "width": 460, "height": 571, "url": "https://img-9gag-fun.9cache.com/photo/aB07d02_460s.jpg", "webpUrl": "https://img-9gag-fun.9cache.com/photo/aB07d02_460swp.webp" }, "image460sv": { "width": 460, "height": 570, "url": "https://img-9gag-fun.9cache.com/photo/aB07d02_460sv.mp4", "hasAudio": 1, "duration": 44 }, "image460svwm": { "width": 460, "height": 570, "url": "https://img-9gag-fun.9cache.com/photo/aB07d02_460svwm.webm", "hasAudio": 1, "duration": 44 } }, "sourceDomain": "", "sourceUrl": "", "commentsCount": 0, "postSection": { "name": "Video", "url": "https://9gag.com/video", "imageUrl": "https://miscmedia-9gag-fun.9cache.com/images/thumbnail-facebook/1557283964.0386_avUmy5_100x100.jpg" }, "tags": [], "descriptionHtml": "" }
Get Fresh Posts:
from ninegagposts import Client Client.get_fresh_posts() #returns a dictionary list
Get Hot Posts:
from ninegagposts import Client Client.get_hot_posts() #returns a dictionary list
Get Trending Posts:
from ninegagposts import Client Client.get_trending_posts() #returns a dictionary list
Get Posts by Group:
from ninegagposts import Client Client.get_posts_by_group(group="default", type="fresh") #returns a dictionary list
Output Example:
[ { "id": "awA6Zor", "url": "http://9gag.com/gag/awA6Zor", "title": "Kinetic Energy - Homage to Alfonso Wong", "type": "Photo", "nsfw": 0, "upVoteCount": 0, "downVoteCount": 0, "creationTs": 1562854100, "promoted": 0, "isVoteMasked": 1, "hasLongPostCover": 0, "images": { "image700": { "width": 700, "height": 1084, "url": "https://img-9gag-fun.9cache.com/photo/awA6Zor_700b.jpg", "webpUrl": "https://img-9gag-fun.9cache.com/photo/awA6Zor_700bwp.webp" }, "image460": { "width": 460, "height": 712, "url": "https://img-9gag-fun.9cache.com/photo/awA6Zor_460s.jpg", "webpUrl": "https://img-9gag-fun.9cache.com/photo/awA6Zor_460swp.webp" } }, "sourceDomain": "", "sourceUrl": "", "commentsCount": 0, "postSection": { "name": "Countryballs", "url": "https://9gag.com/countryballs", "imageUrl": "https://miscmedia-9gag-fun.9cache.com/images/thumbnail-facebook/1557310697.557_Ba4aSa_100x100.jpg" }, "tags": [], "descriptionHtml": "" }, { "id": "a5M8XRN", "url": "http://9gag.com/gag/a5M8XRN", "title": "Americat", "type": "Photo", "nsfw": 0, "upVoteCount": 0, "downVoteCount": 0, "creationTs": 1562854100, "promoted": 0, "isVoteMasked": 1, "hasLongPostCover": 0, "images": { "image700": { "width": 700, "height": 52, "url": "https://img-9gag-fun.9cache.com/photo/a5M8XRN_700b.jpg", "webpUrl": "https://img-9gag-fun.9cache.com/photo/a5M8XRN_700bwp.webp" }, "image460": { "width": 460, "height": 34, "url": "https://img-9gag-fun.9cache.com/photo/a5M8XRN_460s.jpg", "webpUrl": "https://img-9gag-fun.9cache.com/photo/a5M8XRN_460swp.webp" } }, "sourceDomain": "", "sourceUrl": "", "commentsCount": 0, "postSection": { "name": "Countryballs", "url": "https://9gag.com/countryballs", "imageUrl": "https://miscmedia-9gag-fun.9cache.com/images/thumbnail-facebook/1557310697.557_Ba4aSa_100x100.jpg" }, "tags": [], "descriptionHtml": "" } ]
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
ninegagposts-0.0.1.5.tar.gz
(4.8 kB
view hashes)
Built Distribution
Close
Hashes for ninegagposts-0.0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f31649fcde595fd30d175564f16accbc30cc697d06fcee56adcb76659922edd |
|
MD5 | 8a2ac2c22be6d3f8497b34dd07055dff |
|
BLAKE2-256 | 80674d6197f749d754d771baafee58f53a1cf26c20f6cb4382799c14d05f470e |