Skip to content

Latest commit

 

History

History
203 lines (136 loc) · 3.26 KB

README.md

File metadata and controls

203 lines (136 loc) · 3.26 KB

PolarPod

A set of useful apis

this API uses

  • open-graph-crapper
  • word filter [only english support up to now]
  • atob and btoa base64
  • express
  • js-video-url-parser
  • qrcode-svg
  • object-hash

Inside but not in use

  • metafetch [unused, secondary]
  • nano-memoize [unused]
  • mysql

General usage

Og tag getter

https://polarpod.herokuapp.com/apis/ogtags?u=[URL]

parameters:

  • u: url

response:

  • json

SHA/MD5 hashes

https://polarpod.herokuapp.com/apis/hasher?d=[data]&m=[MD5|SHA]

parameters

  • d: data
  • m: hash algorithm

responses

  • json

SVG QR Code generator

https://polarpod.herokuapp.com/apis/qr?u=[URL]&d=[true]/[false]&w=[width]&c=[color]&bg=[background]

parameters:

  • u: data
  • d: dark/light [true/false] (if true generates a lighet qr)
  • w: width
  • c: HEX color (without the #) default colors: for dark themes=#CCCCCC and light=#222222
  • bg: background color in HEX (without the #) default is transparent if any param was send, a message will be showed

response:

  • SVG document

Video URL parser

http://polarpod.herokuapp.com/apis/video/meta?u=[URL]

params:

  • u: video url

response:

  • json

Video thumbnail

same as video url parser, but with different response and url

http://polarpod.herokuapp.com/apis/video/thumb?u=[URL]

supported platforms

  • youtube
  • vimeo

params:

  • u: video url

response:

  • json

Bad-word message filter

https://polarpod.herokuapp.com/apis/filter?msg=[message_to_filter]

params:

  • msg: message

response:

  • json

responses

og tags response sample

  {
    "name": "GitHub",
    "title": "Build software better, together",
    "desc": "description...",
    "type": "",
    "url": "https://github.com",
    "img": "https://github.githubassets.com/images/modules/open_graph/github-logo.png"
  }

video url parser

thumbnails is currently avaliable for youtube and vimeo only for youtube, maxresdefault will be retuned if avaliable, else will return '0.jpg', the same as hqdefault.jpg _for vimeo thumbails the image size '_640' is replaced by '1920'

  {
    "id": "jYCGSuNDy4M",
    "mediaType": "video",
    "provider": "youtube",
    "thumb":"https://img.youtube.com/vi/jYCGSuNDy4M/maxresdefault.jpg"
  },

 {
    "id": "76979871",
    "mediaType": "video",
    "provider": "vimeo",
    "thumb":"https://i.vimeocdn.com/video/452001751_1920.jpg",
    "thumbOriginal":"https://i.vimeocdn.com/video/452001751_640.jpg"
  },

bad-word filter

  {
    "msg":"****"
  }

hasher

  succesfull (status 200)
  {
    "type":"sha",
    "original":"test",
    "hash":"8d56ea07e4ac6175807ed5f66279715d394d8885",
    "success":true
  }

  failed (status 400)
  {
    "type":"sha",
    "original":"test",
    "hash":"",
    "success":false
  }

Modules credits

qrcode-svg by papnkukn

bad-words by web-mech

jsVideoUrlParser by Zod-

openGraphScraper by jshemas

metafetch by brahma-dev

object-hash by addaleax

LICENSE

  • MIT