GithubHelp home page GithubHelp logo

rgab1508 / jokesandpickupapi Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 50 KB

API for Jokes and Pickup lines

Home Page: https://jokeandpickupapi.herokuapp.com

Python 64.28% CSS 10.57% HTML 25.15%
jokes pickup api flask flask-application reddit reddit-api praw praw-reddit

jokesandpickupapi's Introduction

Jokes & Pickup Line Api


This API returns jokes and pickuplines form r/Jokes and r/pickuplines

live-demo: https://jokeandpickupapi.herokuapp.com/

Parameters

Parameter Description Required Default Constraints
time_filter time the post was made Yes None ['all', 'year', 'month', 'week', 'day']
limit Limit the number of post to return No 10 Interger

Endpoints

base_url: https://jokeandpickupapi.herokuapp.com/

Jokes

Endpoint Description Status
/joke/random Get a random joke Active
/joke/new/<limit> Get jokes from New Posts Active
/joke/top/<time_filter>/<limit> Get jokes from Top posts Active
/joke/controversial/<time_filter>/<limit> Get jokes from controversial posts Active
/joke/rising/<time_filter>/<limit> Get jokes form Rising posts Active

Pickup Lines

Endpoint Description Status
/pickup/random Get a random Pickup Line Active
/pickup/new/<limit> Get Pickup Lines from New Posts Active
/pickup/top/<time_filter>/<limit> Get Pickup Lines from Top posts Active
/pickup/controversial/<time_filter>/<limit> Get Pickup Lines from controversial posts Active
/pickup/rising/<time_filter>/<limit> Get Pickup Lines form Rising posts Active

Example

GET https://jokeandpickupapi.herokuapp.com/joke/random

    {
          "id": "i5tz0f",
          "url": "https://www.reddit.com/r/Jokes/comments/i5tz0f/how_dare_the_government_infringe_on_my_freedoms/",
          "upvote_ratio": 0.67,
          "over_18": false,
          "name": "t3_i5tz0f",
          "title": "How dare the Government infringe on my freedoms by forcing me to wear a bit of cloth covering a part of my
          body...",
          "body": "Nudists unite!"
    }
Run the server yourself
setting reddit account && getting api keys
    CLIENT_ID='client id from the app'
    CLIENT_SECRET='client secret from the app'
    USER_NAME='your reddit username'
    USER_PASS='your reddit password'
clone repo and run
  • clone the repository git clone https://github.com/rgab1508/jokeandpickupapi
  • cd jokeandpickupapi
  • pip install -r requirements.txt
  • gunicorn wsgi:app

dependencies

  • flask
  • praw

jokesandpickupapi's People

Contributors

rgab1508 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.