Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

No project description provided

Project description

Ninegagposts

PyPI GitHub license PyPI - Python Version


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.

Files for ninegagposts, version 0.0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size ninegagposts-0.0.1.5-py3-none-any.whl (4.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size ninegagposts-0.0.1.5.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page