Skip to main content

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.

Source Distribution

ninegagposts-0.0.1.5.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

ninegagposts-0.0.1.5-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file ninegagposts-0.0.1.5.tar.gz.

File metadata

  • Download URL: ninegagposts-0.0.1.5.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for ninegagposts-0.0.1.5.tar.gz
Algorithm Hash digest
SHA256 b519a82e74bc4fe2dccef7e899340677fd567d4a1dfb8f0c7a9658f7afdafaef
MD5 d880bd65a03ed8a198d64d9ce668aa5a
BLAKE2b-256 ba00d1f3113b24dc1b8757283ff20257ea23f03a2c7ab51f8fab55b4815b43cf

See more details on using hashes here.

File details

Details for the file ninegagposts-0.0.1.5-py3-none-any.whl.

File metadata

  • Download URL: ninegagposts-0.0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for ninegagposts-0.0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1f31649fcde595fd30d175564f16accbc30cc697d06fcee56adcb76659922edd
MD5 8a2ac2c22be6d3f8497b34dd07055dff
BLAKE2b-256 80674d6197f749d754d771baafee58f53a1cf26c20f6cb4382799c14d05f470e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page