Coder Social home page Coder Social logo

memes-api's Introduction

Memes API Build Status codecov

API for scrapping common meme sites. Written in Python using parsel and Flask. Currently supports:

No sites to be supported, suggest one?

API

/

Response: available sites

[
  "/kwejk",
  "/jbzd",
  "/9gag",
  "/9gagnsfw",
  "/demotywatory",
  "/mistrzowie",
  "/anonimowe",
  "/ifunnyco"
]

Then you can access them by accessing fe. /kwejk

//shortened response
{
  "memes": [
    {
      "title": "Czasy si臋 zmieniaj膮",
      "url": "https://kwejk.pl/obrazek/3387625/czasy-sie-zmieniaja.html",
      "view_url": "/kwejk/3387625",
      "author": {
        "name": "Torendil",
        "url": "https://kwejk.pl/uzytkownik/torendil"
      },
      "comment_count": 18,
      "content": {
        "contentType": "IMAGE",
        "url": "https://i1.kwejk.pl/k/obrazki/2019/05/lJUqdnyKqJf1Katl.jpg"
      },
      "points": 205,
      "tags": [
        {
          "name": "#obrazek",
          "url": "https://kwejk.pl/tag/obrazek"
        },
        {
          "name": "#humor",
          "url": "https://kwejk.pl/tag/humor"
        },
        {
          "name": "#mem",
          "url": "https://kwejk.pl/tag/mem"
        },
        {
          "name": "#true",
          "url": "https://kwejk.pl/tag/true"
        }
      ]
    }
  ],
  "next_page_url": "/kwejk/page/40878",
  "title": "Ministerstwo mem贸w, zdj臋膰 i innych 艣miesznych obrazk贸w - KWEJK.pl"
}

Development

  1. Install dependencies with pipenv
  2. Run development server with python main.py
  3. Make your changes
  4. Write and run tests with pytest in project directory
  5. Format your code using black
  6. If you added new packages run pipenv run pipenv_to_requirements -f
  7. Make a pull request and be happy :)

Deploying Memes API

There are couple ways to deploy Memes API. For now supported options are:

  • Docker image (Dockerfile)
  • ZEIT Now (now.json)
  • Google App Engine (app.yaml)

memes-api's People

Contributors

dependabot[bot] avatar pr0gramista avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

memes-api's Issues

JSONDecodeError occurs while trying to fetch 9gag memes

Hello,
I noticed, that an error occurs when trying to fetch content from /9gag and /9gagnsfw endpoints.
This is thrown while requesting one of endpoints written above.
image
Can you fix this err?
Thanks,
Matt.
PS. Kawa艂 dobrej roboty 馃槃

Add next page url validation

Sometimes next page url is actually wrong for some reason. Validation could be helpful to determine whether next page url is actually what we wanted.

Kwejk is priority here.

Fix 9gag tests

Page scrapper tests were removed, because new API was introduced.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    馃枛 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 馃搳馃搱馃帀

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google 鉂わ笍 Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.